/* Today's Worship — public view supports two styles (A & B) plus light/dark.
 * Theme tokens live on #worship-view; .theme-a (Modern Minimal) and
 * .theme-b (Quiet & Contemplative) switch the look, .dark switches the
 * palette, and [data-size] scales typography. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #faf7f2;
  color: #1a1a1a;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.view { display: none; }
.view.active { display: block; }

button { -webkit-tap-highlight-color: transparent; }

/* ============================================================
   PUBLIC WORSHIP VIEW — themed via .theme-a / .theme-b + .dark
   ============================================================ */

#worship-view {
  --bg: #f5efe2;
  --surface: #ede5d2;
  --ink: #2a2520;
  --muted: #8a7e6a;
  --rule: rgba(42,37,32,0.14);
  --accent: #8a6a3a;

  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  transition: background .25s, color .25s;
}

/* ---- B · Quiet & Contemplative ---- */
#worship-view.theme-b {
  --bg: #fbf7ed;
  --surface: #f1ead9;
  --ink: #1d1812;
  --muted: #8a7e6a;
  --rule: rgba(29,24,18,0.14);
  --accent: #8a6a3a;
  /* Newsreader: serif designed for screen body reading. Higher x-height
   * and optical sizing handle long stanzas better than Garamond. */
  font-family: 'Newsreader', 'Cormorant Garamond', Georgia, serif;
}
#worship-view.theme-b.dark {
  --bg: #1a1816;
  --surface: #221f1c;
  --ink: #ece6da;
  --muted: #8a8278;
  --rule: rgba(236,230,218,0.14);
  --accent: #c9a96a;
}

/* ---- A · Modern Minimal ---- */
#worship-view.theme-a {
  --bg: #F7F6F3;
  --surface: #FCFBF8;
  --ink: #101113;
  --ink-70: #2D3036;
  --muted: #5A5F66;
  --rule: #E4E2DC;
  --rule-soft: #ECEAE3;
  --accent: #1F4D4A;
  --accent-soft: #E6EEEC;
  --dim: rgba(16,17,19,0.55);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.005em;
}
#worship-view.theme-a.dark {
  --bg: #0E1011;
  --surface: #16191B;
  --ink: #F2F1EC;
  --ink-70: #C4C7CB;
  --muted: #8B9099;
  --rule: rgba(242,241,236,0.10);
  --rule-soft: rgba(242,241,236,0.06);
  --accent: #7DB3AE;
  --accent-soft: rgba(125,179,174,0.12);
  --dim: rgba(242,241,236,0.55);
}

/* Type sizes via data-size: 0=S 1=M 2=L 3=XL. Each variant has its own base. */
#worship-view.theme-b { font-size: 17px; line-height: 1.55; }
#worship-view.theme-b[data-size="0"] { font-size: 15.6px; }
#worship-view.theme-b[data-size="2"] { font-size: 19px; }
#worship-view.theme-b[data-size="3"] { font-size: 22px; }

#worship-view.theme-a { font-size: 16px; line-height: 1.5; }
#worship-view.theme-a[data-size="0"] { font-size: 14.7px; }
#worship-view.theme-a[data-size="2"] { font-size: 17.9px; }
#worship-view.theme-a[data-size="3"] { font-size: 20.5px; }

/* ---- Top bar (shared, themed via tokens) ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
}

.topbar-left {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

#worship-view.theme-a .topbar-left {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-70);
}

.topbar-right { display: flex; align-items: center; gap: 4px; }

.tb-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
  height: 30px;
  min-width: 30px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tb-btn:hover { color: var(--ink); }
.tb-btn .sub { font-size: 10px; vertical-align: super; margin-left: 1px; }
.tb-btn .style-indicator { font-weight: 600; font-size: 11px; letter-spacing: 0.04em; }
.tb-btn .dark-indicator { font-size: 13px; }

#worship-view.theme-a .tb-btn { color: var(--ink); font-weight: 600; }
.size-down { font-size: 11px; }
.size-up { font-size: 14px; }

#worship-view.theme-a .size-down {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
#worship-view.theme-a .size-up {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.tb-sep { width: 1px; align-self: stretch; background: var(--rule); margin: 4px 4px; }

/* ---- Header ---- */
.worship-header { text-align: center; }

.worship-title {
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hdr-church {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.hdr-divider { display: none; }

/* B (Quiet) header */
#worship-view.theme-b .worship-header {
  padding: 56px 28px 56px;
}
#worship-view.theme-b .worship-title {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.4rem, 9vw, 2.95rem);
  line-height: 1.05;
  color: var(--accent);
}
#worship-view.theme-b .hdr-church { display: none; }
#worship-view.theme-b .hdr-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
}
#worship-view.theme-b .hdr-rule {
  flex: 0 0 auto;
  width: 64px;
  height: 1px;
  background: var(--rule);
}
#worship-view.theme-b .hdr-ornament {
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
}

/* A (Modern) header */
#worship-view.theme-a .worship-header {
  padding: 32px 22px 22px;
  text-align: left;
  display: flex;
  flex-direction: column;
}
#worship-view.theme-a .worship-title {
  order: 2;
  font-weight: 700;
  font-size: clamp(2.4rem, 11vw, 3.25rem);
  letter-spacing: -0.04em;
  line-height: 1.0;
}
#worship-view.theme-a .hdr-church {
  order: 1;
  margin: 0 0 14px;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
#worship-view.theme-a .hdr-divider { display: none; }

/* ---- Mini-nav (style A / Modern only) ---- */
.mini-nav { display: none; }
#worship-view.theme-a .mini-nav {
  display: flex;
  gap: 6px;
  padding: 10px 22px 12px;
  margin-bottom: 28px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline-start: 22px;
  scroll-padding-inline-end: 22px;

  /* Stick beneath the top bar as the user scrolls past */
  position: sticky;
  top: 49px;
  z-index: 15;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
#worship-view.theme-a .mini-nav::after {
  content: '';
  flex: 0 0 1px;
}
#worship-view.theme-a .mini-nav::-webkit-scrollbar { display: none; }

.mini-pill {
  flex: 0 0 auto;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.mini-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

#worship-view.theme-a .mini-pill {
  padding: 9px 16px;
  font-size: 13px;
  color: var(--ink-70);
}
#worship-view.theme-a .mini-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ---- Blocks container ---- */
.blocks { padding: 0 22px 60px; }
#worship-view.theme-b .blocks { padding: 0 28px 60px; }

/* ---- Block separators ---- */
#worship-view.theme-b .block + .block::before {
  content: '· · ·';
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  letter-spacing: 0.6em;
  margin: 48px 0;
}
#worship-view.theme-a .block {
  padding-top: 28px;
  padding-bottom: 28px;
}
#worship-view.theme-a .block + .block { border-top: 1px solid var(--rule); }
#worship-view.theme-a .block:first-child { padding-top: 0; }

/* ============================================================
   SONG BLOCK
   ============================================================ */

.song-title { margin: 0; }
.song-attribution {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* B (Quiet): centered, serif, italic chorus in accent */
#worship-view.theme-b .song-head { text-align: center; margin-bottom: 28px; }
#worship-view.theme-b .song-title {
  font-weight: 500;
  font-size: clamp(1.55rem, 6vw, 1.85rem);
  letter-spacing: -0.005em;
  line-height: 1.15;
}
#worship-view.theme-b .song-attribution { margin-top: 8px; }
#worship-view.theme-b .stanzas { text-align: center; }
#worship-view.theme-b .stanza { margin-bottom: 22px; }
#worship-view.theme-b .stanza.chorus {
  color: var(--accent);
  font-weight: 500;
}

/* A (Modern): left-aligned, sans, chorus has accent rule */
#worship-view.theme-a .song-head { margin-bottom: 26px; }
#worship-view.theme-a .song-title {
  font-weight: 700;
  font-size: clamp(1.5rem, 5.6vw, 1.625rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 4px;
}
#worship-view.theme-a .song-attribution {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--muted);
}
#worship-view.theme-a .stanzas { color: var(--ink); }
#worship-view.theme-a .stanza {
  margin-bottom: 22px;
  font-size: 1.125em;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.005em;
}
#worship-view.theme-a .stanza.chorus {
  position: relative;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  font-weight: 600;
  color: var(--ink);
}

/* Chorus repeat marker — appears for any chorus stanza after the first.
 * Same accent rule, but body collapsed to a small "repeat" tag. */
#worship-view.theme-a .chorus-repeat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  margin: 4px 0 22px;
}
#worship-view.theme-a .chorus-repeat-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
#worship-view.theme-a .chorus-repeat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}
#worship-view.theme-b .chorus-repeat { display: none; }

/* ============================================================
   SCRIPTURE BLOCK
   ============================================================ */

.scripture-reference { margin: 0; font-weight: 500; }
.scripture-version {
  margin-top: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}
#worship-view.theme-b .scripture-version {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-top: 8px;
}
.scripture-prose { margin: 0; }
.verse-num {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  margin-right: 3px;
  vertical-align: super;
}

/* B (Quiet): accent reference, prose with text indent */
#worship-view.theme-b .scripture-head {
  text-align: center;
  margin-bottom: 22px;
}
#worship-view.theme-b .scripture-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
#worship-view.theme-b .scripture-reference {
  font-style: italic;
  font-size: clamp(1.6rem, 6vw, 2rem);
  color: var(--accent);
}
#worship-view.theme-b .scripture-prose {
  text-indent: 1.6em;
  text-align: left;
}
#worship-view.theme-b .verse-num {
  font-size: 0.62em;
  color: var(--accent);
}

/* A (Modern): hanging verse layout — reference, then verses one per row */
#worship-view.theme-a .scripture-eyebrow { display: none; }
#worship-view.theme-a .scripture-head { margin-bottom: 24px; }
#worship-view.theme-a .scripture-reference {
  font-size: clamp(1.55rem, 5.6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
}
#worship-view.theme-a .scripture-prose,
#worship-view.theme-a .verses {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  text-indent: 0;
}
#worship-view.theme-a .scripture-prose .verse-num,
#worship-view.theme-a .verses .verse-num {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 12px;
  width: 20px;
  flex-shrink: 0;
  color: var(--accent);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  vertical-align: baseline;
  margin-right: 0;
  padding-top: 4px;
}
#worship-view.theme-a .verse-row {
  display: flex;
  gap: 14px;
  align-items: baseline;
}
#worship-view.theme-a .verse-text {
  font-size: 1.125em;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: -0.005em;
}

/* ============================================================
   NOTE BLOCK
   ============================================================ */

.note-card { padding: 0; }
.note-title { margin: 0 0 14px; font-weight: 500; }
.note-card p { margin: 0 0 14px; text-wrap: pretty; }
.note-card p:last-child { margin-bottom: 0; }

/* B (Quiet): just an indent and an accent rule — no warm background */
#worship-view.theme-b .note-card {
  background: transparent;
  border-radius: 0;
  padding: 0 0 0 22px;
  border-left: 2px solid var(--accent);
}
#worship-view.theme-b .note-title {
  font-style: italic;
  font-size: clamp(1.15rem, 4.5vw, 1.3rem);
  letter-spacing: -0.005em;
}

/* A (Modern): rounded card, no tab/labels per the design feedback */
#worship-view.theme-a .note-card {
  background: var(--surface);
  border: 1px solid rgba(16,17,19,0.18);
  border-radius: 12px;
  padding: 22px 22px 24px;
  box-shadow: 0 1px 2px rgba(16,17,19,0.04);
}
#worship-view.theme-a.dark .note-card {
  border-color: rgba(242,241,236,0.22);
  box-shadow: none;
}
#worship-view.theme-a .note-eyebrow { display: none; }
#worship-view.theme-a .note-title {
  font-size: 1.25em;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 14px;
}
#worship-view.theme-a .note-card p {
  font-size: 1em;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--ink-70);
  margin: 0 0 14px;
}
#worship-view.theme-a .note-card p:last-child { margin-bottom: 0; }
#worship-view.theme-a .note-card strong { font-weight: 600; color: var(--ink); }
#worship-view.theme-b .note-eyebrow { display: none; }

/* ============================================================
   FOOTER
   ============================================================ */

.worship-footer {
  padding: 0 22px 60px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  color: var(--muted);
}

#worship-view.theme-b .worship-footer {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 16px;
}

#worship-view.theme-a .worship-footer {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  margin: 24px 22px 60px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-size: 0.95rem;
}

.topbar-wordmark {
  color: inherit;
  text-decoration: none;
}
.topbar-wordmark:hover { color: var(--ink); }

/* ============================================================
   LOGIN VIEW
   ============================================================ */

#login-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
#login-view.active { display: flex; }

.login-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04);
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 420px;
}
.login-card h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.85rem;
  margin: 0 0 .5rem;
  font-weight: 600;
}
.login-sub { color: #8a8a8a; margin: 0 0 1.5rem; font-size: .95rem; }
#login-form { display: flex; flex-direction: column; gap: .5rem; }

label {
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a8a8a;
  font-weight: 500;
}

input[type="email"], input[type="text"], textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: .75rem .875rem;
  border: 1px solid #e8e2d6;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  border-color: #6b4f2a;
  box-shadow: 0 0 0 3px #f1ead9;
}
textarea { resize: vertical; min-height: 180px; line-height: 1.6; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .92rem; }

.login-message { margin-top: 1rem; font-size: .9rem; color: #6b4f2a; min-height: 1.2em; }
.login-message.error { color: #b00020; }
.back-link { display: block; margin-top: 1.5rem; font-size: .85rem; color: #8a8a8a; text-decoration: none; }
.back-link:hover { color: #1a1a1a; }

#onboarding-form { display: flex; flex-direction: column; gap: .5rem; }
.slug-input-row {
  display: flex;
  align-items: stretch;
  border: 1px solid #e8e2d6;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.slug-input-row:focus-within {
  border-color: #6b4f2a;
  box-shadow: 0 0 0 3px #f1ead9;
}
.slug-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 .5rem 0 .875rem;
  color: #8a8a8a;
  font-size: .92rem;
  white-space: nowrap;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.slug-input-row input[type="text"] {
  border: none;
  border-radius: 0;
  padding-left: 0;
  background: transparent;
}
.slug-input-row input[type="text"]:focus { box-shadow: none; }
.slug-availability {
  font-size: .82rem;
  min-height: 1.1em;
  margin-top: .15rem;
  color: #8a8a8a;
}
.slug-availability.ok { color: #2e7d32; }
.slug-availability.error { color: #b00020; }
.slug-availability.checking { color: #8a8a8a; font-style: italic; }

.picker-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  border: 1px solid #e8e2d6;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: left;
  font: inherit;
  width: 100%;
}
.picker-item:hover { border-color: #6b4f2a; background: #fbf8f0; }
.picker-item-name { font-weight: 600; color: #1a1a1a; }
.picker-item-slug {
  color: #8a8a8a;
  font-size: .82rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.picker-item-role {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #b08a4a;
  margin-left: .5rem;
}
.picker-add {
  margin-top: .9rem;
  padding: .75rem;
  border: 1px dashed #c8b896;
  border-radius: 10px;
  background: transparent;
  color: #6b4f2a;
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
  width: 100%;
}
.picker-add:hover { background: #fbf8f0; }

/* ============================================================
   ADMIN VIEW
   ============================================================ */

#admin-view {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #faf7f2;
  margin: 0 -1.25rem 1.5rem;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid #e8e2d6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.admin-header h2 {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #2a2a2a;
}
.admin-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.signed-in {
  font-size: .85rem;
  color: #8a8a8a;
  max-width: 14ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-body { display: flex; flex-direction: column; gap: 1rem; }

.item-card {
  background: #fff;
  border: 1px solid #e8e2d6;
  border-radius: 14px;
  padding: 1rem 1rem 1.25rem;
}
.item-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}
.item-card-num {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a8a8a;
}
.item-card-actions { display: flex; align-items: center; gap: .25rem; }

.icon-btn {
  background: transparent;
  border: 1px solid #e8e2d6;
  color: #4a4a4a;
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover:not(:disabled) { background: #fafafa; color: #1a1a1a; }
.icon-btn:disabled { opacity: .35; cursor: default; }

.remove-btn {
  background: none; border: none; color: #8a8a8a;
  cursor: pointer; font-size: .85rem; padding: .25rem .5rem;
}
.remove-btn:hover { color: #b00020; }

.item-card label { margin-top: .5rem; display: block; margin-bottom: .25rem; }

.field-hint {
  font-size: .75rem;
  color: #8a8a8a;
  margin-top: .25rem;
  font-family: 'Inter', sans-serif;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.style-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: .25rem;
}
.style-option {
  background: #fff;
  border: 1px solid #e8e2d6;
  border-radius: 10px;
  padding: .85rem .95rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.style-option:hover { border-color: #c9b894; }
.style-option.selected {
  border-color: #6b4f2a;
  box-shadow: 0 0 0 2px #f1ead9;
}

/* Style A preview: paper bg, Inter, modern accent */
.style-option[data-style="a"] {
  background: #F7F6F3;
}
.style-option[data-style="a"] .style-option-label {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #101113;
}
.style-option[data-style="a"] .style-option-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #1F4D4A;
}

/* Style B preview: cream bg, Newsreader italic, warm gold accent */
.style-option[data-style="b"] {
  background: #fbf7ed;
}
.style-option[data-style="b"] .style-option-label {
  font-family: 'Newsreader', 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: -0.005em;
  line-height: 1;
  color: #8a6a3a;
}
.style-option[data-style="b"] .style-option-name {
  font-family: 'Newsreader', 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: .95rem;
  color: #4a4a4a;
  letter-spacing: .005em;
}

.add-row {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .5rem 0 .25rem;
}
.add-row .add-label {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-right: .25rem;
}
.add-row .btn { padding: .55rem .95rem; font-size: .9rem; }

.save-bar {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, #faf7f2 60%, rgba(250,247,242,0));
  padding: 1rem 0 .25rem;
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.save-bar-meta {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  align-items: center;
  padding: 0 0 .75rem;
  font-size: .82rem;
  min-height: 1.2em;
}
.save-message {
  color: #6b4f2a;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  padding: .7rem 1.25rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #1a1a1a; color: #fff; }
.btn-primary:hover { background: #000; }
.btn-secondary { background: #f1ead9; color: #6b4f2a; border-color: #f1ead9; }
.btn-secondary:hover { background: #e9dfc4; }
.btn-ghost { background: transparent; color: #4a4a4a; border-color: #e8e2d6; }
.btn-ghost:hover { background: #fff; }

#login-form .btn-primary { margin-top: .75rem; width: 100%; }

/* ============================================================
   LANDING / ABOUT VIEW
   ============================================================ */

#landing-view {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #15141a;
  --muted: #85827a;
  --rule: rgba(21,20,26,0.10);
  --dim: rgba(21,20,26,0.6);

  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Inter', system-ui, -apple-system, system-ui, sans-serif;
  letter-spacing: -0.005em;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.landing-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--rule);
}

.landing-wordmark {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.landing-nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .15s;
}
.landing-nav-link:hover { background: rgba(21,20,26,0.05); }

.landing-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 22px 80px;
}

/* ---- Hero ---- */
.landing-hero { text-align: center; }

.landing-headline {
  margin: 0 0 18px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--ink);
}

.landing-sub {
  margin: 0 auto 32px;
  max-width: 540px;
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  line-height: 1.5;
  color: var(--dim);
}

.landing-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.landing-cta .btn { font-size: 1rem; padding: .85rem 1.4rem; }

/* ---- Phone preview ---- */
.landing-preview {
  margin: 64px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.phone-frame {
  position: relative;
  width: 320px;
  max-width: calc(100vw - 44px);
  aspect-ratio: 9 / 18;
  background: #1a1a1a;
  border-radius: 38px;
  padding: 8px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.06),
    0 16px 40px rgba(0,0,0,0.16),
    0 2px 6px rgba(0,0,0,0.08);
  overflow: hidden;
}

.phone-screen-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: var(--bg);
  /* Force a clipping layer so iOS Safari respects border-radius on iframes */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  transform: translateZ(0);
}

.phone-screen {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg);
  display: block;
}

.landing-preview-caption {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* The phone-frame iframe loads /demo with this same stylesheet. The
 * default desktop scrollbar looks bulky inside a 320px-wide phone
 * preview, so when we're embedded (html.embedded set by app.js)
 * render a slim, semi-transparent grey scrollbar that reads well
 * against both light and dark themes. */
html.embedded {
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.45) transparent;
}
html.embedded ::-webkit-scrollbar { width: 6px; height: 6px; }
html.embedded ::-webkit-scrollbar-track { background: transparent; }
html.embedded ::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.45);
  border-radius: 3px;
}
html.embedded ::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.7);
}

/* ---- Steps ---- */
.landing-steps {
  margin-top: 96px;
  padding-top: 56px;
  border-top: 1px solid var(--rule);
}

.landing-section-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  text-align: center;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .step { text-align: center; }
  .step-num { margin-left: auto; margin-right: auto; }
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 720px) {
  .step { grid-template-columns: 1fr; gap: 14px; }
}

.step-num {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  letter-spacing: 0;
}

.step-title {
  margin: 0 0 6px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.step-text {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--dim);
}

.steps-cta {
  margin-top: 36px;
  text-align: center;
}

.see-live {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity .15s;
}
.see-live:hover { opacity: 0.7; }

/* ---- Landing footer ---- */
.landing-footer {
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-family: 'Inter', sans-serif;
}

.landing-wordmark-sm {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}

.landing-footer-text {
  font-size: 13px;
  color: var(--muted);
}

.landing-footer-text a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(21,20,26,0.2);
  text-underline-offset: 3px;
}
.landing-footer-text a:hover { text-decoration-color: var(--ink); }


/* ============================================================
   KIOSK VIEW (big QR for tablets / shared screens)
   ============================================================ */

#kiosk-view {
  background: #f7f5f0;
  color: #15141a;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.005em;
}
#kiosk-view.active { display: flex; }

.kiosk-frame {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 28px env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.kiosk-header { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.kiosk-wordmark {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #85827a;
}

.kiosk-church {
  margin: 4px 0 0;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.kiosk-subtitle {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: rgba(21,20,26,0.55);
}

.kiosk-qr {
  margin-top: 8px;
  width: min(60vmin, 420px);
  height: min(60vmin, 420px);
  padding: 20px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.08);
  overflow: hidden;
}
.kiosk-qr svg path { fill: #15141a; }

.kiosk-caption {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: #15141a;
  line-height: 1.45;
}
.kiosk-url {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85em;
  color: #85827a;
  margin-top: 6px;
  word-break: break-all;
}

.kiosk-controls {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.kiosk-back {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #85827a;
  text-decoration: none;
  padding: 6px 8px;
}
.kiosk-back:hover { color: #15141a; }

/* ============================================================
   ADMIN — SHARE CARD
   ============================================================ */

.share-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  flex-wrap: wrap;
}

.share-qr {
  flex: 0 0 auto;
  width: 110px;
  height: 110px;
  background: #fff;
  border: 1px solid #e8e2d6;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.share-qr svg path { fill: #15141a; }

.share-info {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-label {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.share-url {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .85rem;
  color: #1a1a1a;
  word-break: break-all;
  line-height: 1.4;
}

.share-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.share-actions .btn { padding: .5rem .85rem; font-size: .85rem; }

/* ============================================================
   TEXT WRAPPING — avoid single-word orphans on the last line
   ============================================================
   Modern browsers' "pretty" algorithm pulls a word back from the
   last line when it would otherwise sit alone. "balance" keeps
   short titles wrapping in equal-length chunks. */

.stanza > div,
.verse-text,
.scripture-prose,
.note-card p {
  text-wrap: pretty;
}

.worship-title,
.song-title,
.scripture-reference,
.note-title {
  text-wrap: balance;
}

/* ============================================================
   ADMIN — SONG TITLE AUTOCOMPLETE
   ============================================================ */

.title-wrap { position: relative; }

.song-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid #e8e2d6;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.song-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 6px;
}
.song-suggest-item + .song-suggest-item { margin-top: 1px; }
.song-suggest-item:hover,
.song-suggest-item:focus { background: #f7f5f0; outline: none; }

.song-suggest-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #1a1a1a;
}
.song-suggest-meta {
  font-size: 0.78rem;
  color: #8a8a8a;
  margin-top: 2px;
}

/* ============================================================
   ADMIN — TOOLBAR + PANELS + LIBRARY + DRAG
   ============================================================ */

/* Compact toolbar buttons in the admin header */
.admin-tool {
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  background: transparent;
  color: #4a4a4a;
  border: 1px solid #e8e2d6;
  border-radius: 8px;
  padding: .4rem .7rem;
  cursor: pointer;
}
.admin-tool:hover { background: #fff; }
.admin-tool.is-active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* Always-visible date card — gentle emphasis */
.date-card { border-color: #d8d2c4; }

/* Toggleable panels collapse via the [hidden] attribute */
.admin-panel[hidden] { display: none; }

/* Library list */
.library-hint {
  font-size: .75rem;
  color: #8a8a8a;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.library-empty {
  color: #8a8a8a;
  font-size: .9rem;
  padding: 1rem 0;
}

.library-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  border: 1px solid #f1ead9;
  border-radius: 10px;
  background: #fafafa;
}
.library-item-info { flex: 1 1 auto; min-width: 0; }
.library-item-title {
  font-size: .95rem;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.library-item-meta {
  font-size: .78rem;
  color: #8a8a8a;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Drag handle */
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: .25rem;
  color: #b8b3a8;
  cursor: grab;
  font-size: .9rem;
  letter-spacing: -2px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }

/* Sortable visual states */
.item-card-ghost {
  opacity: .35;
  background: #f1ead9;
}
.item-card-chosen {
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}
.library-actions .btn { padding: .5rem .85rem; font-size: .85rem; }

/* ============================================================
   ADMIN — MODALS, COLLAPSED CARDS, MEMBERS, EDITOR TOOLBAR
   ============================================================ */

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 15, 15, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 1rem 1rem;
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
body.modal-open { overflow: hidden; }

.modal-card {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 12vh);
  max-height: calc(100dvh - 12vh);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #ece7da;
}
.modal-head h3 {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #4a4a4a;
  padding: 0 .25rem;
}
.modal-close:hover { color: #1a1a1a; }

.modal-body {
  padding: 1rem 1.25rem 1.5rem;
  overflow-y: auto;
}

/* Breathing room between form groups in modals */
.modal-body label {
  display: block;
  margin-top: 1.4rem;
  margin-bottom: .4rem;
}
.modal-body > label:first-of-type,
.modal-body > .modal-hint + label,
.modal-body > .modal-hint + .bulk-actions + label {
  margin-top: 0;
}
.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="date"] {
  margin-bottom: .25rem;
}
.modal-body .style-picker { margin-top: .35rem; }
.modal-body .field-hint { margin-top: .35rem; margin-bottom: .25rem; }

.settings-url {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .9rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  padding: .55rem .7rem;
  border-radius: 6px;
  word-break: break-all;
  user-select: all;
}

.settings-divider {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.6rem 0 .25rem;
}

/* Editor toolbar above the song-editor */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .25rem 0 .75rem;
  flex-wrap: wrap;
}
.editor-toolbar-label {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-right: auto;
}

/* Collapsible block cards */
.item-card-summary {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .9rem;
  color: #4a4a4a;
  margin: 0 .5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-card.is-collapsed .item-card-body { display: none; }
.item-card.is-collapsed { padding-bottom: .85rem; }
.item-card.is-collapsed .item-card-num {
  margin-right: .25rem;
}
.item-card-body { display: block; }

/* Members section in Settings */
.settings-divider {
  height: 1px;
  background: #ece7da;
  margin: 1.25rem 0 .75rem;
}
.members-head {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .5rem;
}
.members-title {
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a8a8a;
  font-weight: 500;
}
.members-pending-tag {
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #b08840;
  background: #fbf1de;
  border-radius: 6px;
  padding: 1px 6px;
}
.members-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: .65rem;
}
.member-row {
  display: flex;
  align-items: center;
  padding: .55rem .75rem;
  border: 1px solid #f1ead9;
  border-radius: 10px;
  background: #fafafa;
}
.member-info { flex: 1 1 auto; min-width: 0; }
.member-email {
  font-size: .92rem;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-meta {
  font-size: .76rem;
  color: #8a8a8a;
  margin-top: 1px;
}
.member-tag {
  display: inline-block;
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: .35rem;
  vertical-align: middle;
}
.member-tag.owner { color: #6b4f2a; background: #f1ead9; }
.member-tag.pending { color: #b08840; background: #fbf1de; }
.members-empty {
  font-size: .9rem;
  color: #8a8a8a;
  padding: .75rem .25rem;
  text-align: center;
}
.member-action {
  background: none;
  border: none;
  color: #6b4f2a;
  cursor: pointer;
  font-size: .85rem;
  padding: .25rem .5rem;
  white-space: nowrap;
}
.member-action:hover { color: #1a1a1a; }

.members-invite {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-top: .5rem;
}
.members-invite input { flex: 1 1 auto; }
.members-invite .btn { padding: .55rem .85rem; font-size: .9rem; }

/* ============================================================
   ADMIN — SAVE STATUS, BULK PASTE MODAL, ARCHIVE STUB
   ============================================================ */

/* Save status text — now sits in the save-bar-meta row below the buttons */
.save-status {
  font-size: .8rem;
  color: #8a8a8a;
  font-weight: 500;
  letter-spacing: .01em;
}
.save-status[data-state="saving"] { color: #6b4f2a; }
.save-status[data-state="saved"]  { color: #4a8a4a; }
.save-status[data-state="dirty"]  { color: #8a8a8a; }

/* Slug not-found view */
.notfound-card { text-align: center; }
.notfound-slug {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: .35rem .65rem;
  background: #f7f1e2;
  border-radius: 6px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .9rem;
  color: #6b4f2a;
}
.notfound-card .btn { margin-top: .5rem; }

/* Plan empty state — first-run before any service exists */
.plan-empty-state {
  margin: 2.5rem 0;
  padding: 2rem 1.25rem;
  text-align: center;
}
.plan-empty-state h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0 0 .4rem;
}
.plan-empty-state p {
  color: #8a8a8a;
  margin: 0 auto 1.5rem;
  max-width: 28rem;
  font-size: .95rem;
  line-height: 1.5;
}

/* Past services list */
.past-services-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: .65rem;
  max-height: 60vh;
  overflow-y: auto;
}
.past-service-row {
  display: flex;
  align-items: center;
  padding: .65rem .8rem;
  border: 1px solid #f1ead9;
  border-radius: 10px;
  background: #fafafa;
  gap: .75rem;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.past-service-row:hover { border-color: #6b4f2a; background: #fbf8f0; }
.past-service-info { flex: 1 1 auto; min-width: 0; }
.past-service-date {
  font-size: .92rem;
  font-weight: 500;
  color: #1a1a1a;
}
.past-service-meta {
  font-size: .78rem;
  color: #8a8a8a;
  margin-top: 1px;
}
.past-service-actions {
  flex: 0 0 auto;
  display: flex;
  gap: .35rem;
}
.past-service-dup {
  background: none;
  border: 1px solid #e8e2d6;
  border-radius: 8px;
  padding: .25rem .55rem;
  font-size: .8rem;
  color: #6b4f2a;
  cursor: pointer;
}
.past-service-dup:hover { background: #fbf8f0; border-color: #6b4f2a; }
.past-services-empty {
  font-size: .9rem;
  color: #8a8a8a;
  padding: .75rem .25rem;
  text-align: center;
}

/* Wider bulk-paste modal */
.modal-card-wide { max-width: 720px; }

.modal-hint {
  font-size: .9rem;
  color: #4a4a4a;
  margin: 0 0 .9rem;
  line-height: 1.5;
}
.modal-hint code {
  background: #f1ead9;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .82rem;
  color: #6b4f2a;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

.bulk-actions {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.bulk-actions .btn { padding: .45rem .8rem; font-size: .85rem; }

.bulk-paste-input {
  width: 100%;
  min-height: 280px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .88rem;
  line-height: 1.55;
  padding: .85rem 1rem;
  border: 1px solid #e8e2d6;
  border-radius: 10px;
  background: #fafafa;
  resize: vertical;
}
.bulk-paste-input:focus {
  border-color: #6b4f2a;
  box-shadow: 0 0 0 3px #f1ead9;
  outline: none;
  background: #fff;
}

.format-key {
  margin-top: .85rem;
  font-size: .85rem;
}
.format-key summary {
  cursor: pointer;
  color: #4a4a4a;
  font-weight: 500;
  padding: .35rem 0;
  user-select: none;
}
.format-key summary:hover { color: #1a1a1a; }
.format-key ul {
  margin: .35rem 0 0 0;
  padding-left: 1.1rem;
  color: #4a4a4a;
  line-height: 1.55;
}
.format-key li + li { margin-top: .35rem; }
.format-key code {
  background: #f1ead9;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .82rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.modal-action-status {
  margin-right: auto;
  color: #b00020;
  font-size: .85rem;
}

/* ============================================================
   MOBILE TWEAKS — modals + style picker
   ============================================================ */

@media (max-width: 480px) {
  .modal-overlay { padding: 2vh .5rem .5rem; }
  .modal-card {
    max-height: calc(100vh - 4vh);
    max-height: calc(100dvh - 4vh);
    border-radius: 12px;
  }
  .modal-head { padding: .85rem 1rem; }
  .modal-head h3 { font-size: 1rem; }
  .modal-body { padding: .85rem 1rem 1rem; }

  .style-picker { grid-template-columns: 1fr; }

  .members-invite { flex-direction: column; align-items: stretch; gap: .4rem; }
  .members-invite .btn { width: 100%; }

  .share-row { flex-direction: column; align-items: flex-start; }
  .share-actions { width: 100%; }
  .share-actions .btn { flex: 1 1 auto; }

  .modal-actions { gap: .35rem; }
  .modal-actions .btn { flex: 1 1 auto; }
  .modal-action-status { flex: 1 1 100%; margin: 0 0 .3rem; text-align: left; }

  .admin-header {
    margin: 0 -1.25rem 1rem;
    padding: .75rem 1.25rem;
  }
  .admin-header h2 { font-size: 12px; letter-spacing: 0.14em; }
  .admin-tool { padding: .35rem .55rem; font-size: .78rem; }
}

/* ============================================================
   ADMIN — DATE PICKER + CUSTOM LABEL
   ============================================================ */

#service-date-input {
  font-family: inherit;
  font-size: 1rem;
  padding: .65rem .75rem;
  border: 1px solid #e8e2d6;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  width: auto;
  min-width: 0;
  max-width: 100%;
}

.date-preview {
  font-size: .82rem;
  color: #6b4f2a;
  margin: .35rem 0 .25rem;
  min-height: 1.1em;
}

.custom-label-section {
  margin-top: .5rem;
  border-top: 1px dashed #ece7da;
  padding-top: .65rem;
}
.custom-label-section[open] { padding-top: .75rem; }
.custom-label-section summary {
  cursor: pointer;
  user-select: none;
  font-size: .82rem;
  color: #6a6a6a;
  padding: .15rem 0;
  list-style: none;
}
.custom-label-section summary::-webkit-details-marker { display: none; }
.custom-label-section summary::before {
  content: '▸ ';
  display: inline-block;
  margin-right: .25rem;
  transition: transform .15s;
}
.custom-label-section[open] summary::before { content: '▾ '; }
.custom-label-section summary:hover { color: #1a1a1a; }
.custom-label-section input[type="text"] {
  margin-top: .5rem;
}

/* ============================================================
   ADMIN — SERVICE PICKER (multi-service)
   ============================================================ */

.service-picker {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: .25rem 0 .5rem;
  margin: 0 0 .25rem;
}
.service-picker::-webkit-scrollbar { display: none; }

.service-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  background: #fff;
  border: 1px solid #e8e2d6;
  border-radius: 999px;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 500;
  color: #4a4a4a;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.service-pill:hover { background: #fafafa; }

.service-pill.is-active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.service-pill.is-new {
  background: transparent;
  border-style: dashed;
  color: #6b4f2a;
}
.service-pill.is-new:hover { background: #f1ead9; }

.service-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4a8a4a;
  display: inline-block;
  flex-shrink: 0;
}
.service-pill.is-active .service-live-dot { background: #7fd17f; }

.service-pill.is-live:not(.is-active)::after {
  content: 'live';
  margin-left: .15rem;
  font-size: .7rem;
  letter-spacing: .04em;
  color: #4a8a4a;
  font-weight: 600;
  text-transform: uppercase;
}

/* Delete-service button at the bottom of the date card */
.delete-service-btn {
  margin-top: 1rem;
  background: transparent;
  border: 1px solid #e8e2d6;
  color: #8a8a8a;
  font-family: inherit;
  font-size: .82rem;
  padding: .5rem .85rem;
  border-radius: 8px;
  cursor: pointer;
  align-self: flex-start;
}
.delete-service-btn:hover { color: #b00020; border-color: #d8a8a8; }

@media (max-width: 480px) {
  .delete-service-btn { width: 100%; }
}

/* ============================================================
   ADMIN — GEAR MENU (Settings + Library hidden behind hamburger)
   ============================================================ */

.admin-menu-wrap {
  position: relative;
}

.admin-menu-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #e8e2d6;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  min-width: 160px;
  padding: 4px;
}
.admin-menu[hidden] { display: none; }

.admin-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: .9rem;
  color: #1a1a1a;
  padding: .55rem .7rem;
  border-radius: 6px;
  cursor: pointer;
}
.admin-menu-item:hover { background: #f7f5f0; }

.admin-menu-email {
  font-size: .78rem;
  color: #8a8a8a;
  padding: .5rem .7rem .35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-menu-email:empty { display: none; }

.admin-menu-divider {
  height: 1px;
  background: #ece7da;
  margin: 4px 6px;
}

/* ============================================================
   PLAN VIEW (admin redesign)
   Tokens scoped to #admin-view so the public worship view's
   palette stays untouched.
   ============================================================ */

#admin-view {
  --paper: #F7F6F3;
  --paper-alt: #FCFBF8;
  --paper-deep: #F0EDE6;
  --plan-ink: #101113;
  --plan-ink-70: #2D3036;
  --plan-ink-55: #5A5F66;
  --plan-ink-35: #8B9099;
  --plan-rule: #E4E2DC;
  --plan-rule-soft: #ECEAE3;
  --plan-accent: #1F4D4A;
  --plan-accent-soft: #E6EEEC;
  --plan-accent-ink: #143534;
  --plan-live: #2F8F5A;
  --plan-draft: #B5841F;
  --plan-danger: #B33A3A;
  --plan-shadow-card: 0 1px 0 rgba(16,17,19,0.04), 0 8px 24px -12px rgba(16,17,19,0.08);

  background: var(--paper);
  color: var(--plan-ink);
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 100px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

#admin-view button { font-family: inherit; cursor: pointer; }

/* --- Top bar --- */
.plan-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px 6px;
}
.plan-eyebrow {
  font-size: 11.5px;
  letter-spacing: 1.6px;
  font-weight: 700;
  color: var(--plan-ink-55);
  text-transform: uppercase;
}
.plan-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--plan-rule);
  border-radius: 10px;
  background: transparent;
  color: var(--plan-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.plan-icon-btn svg { width: 16px; height: 16px; }

/* --- Page title --- */
.plan-title { padding: 8px 22px 14px; }
.plan-title h1 {
  font-size: 32px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -1.2px;
  margin: 0;
  font-family: inherit;
}
.plan-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--plan-ink-55);
  font-weight: 500;
  letter-spacing: -0.05px;
}

/* --- Date switcher (sticky) --- */
.switcher-wrap {
  border-top: 1px solid var(--plan-rule);
  border-bottom: 1px solid var(--plan-rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.switcher-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.switcher-row::-webkit-scrollbar { display: none; }
.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--plan-ink-70);
  border: 1px solid var(--plan-rule);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: -0.05px;
  transition: background .15s, color .15s, border-color .15s;
}
.date-pill:hover { background: var(--paper-alt); }
.date-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--plan-ink-35);
  flex-shrink: 0;
}
.date-pill .pill-dot.live { background: var(--plan-live); }
.date-pill .pill-dot.scheduled { background: var(--plan-accent); }
.date-pill.is-active {
  background: var(--plan-ink);
  color: var(--paper);
  border-color: var(--plan-ink);
}
.date-pill.is-active .pill-dot.live { background: #6FE3A2; }
.date-pill.is-active .pill-dot.scheduled { background: #7FB6B2; }
.date-pill.new {
  border-style: dashed;
  color: var(--plan-accent);
  border-color: var(--plan-accent);
}

/* --- Service header card (collapsible) --- */
.service-header {
  margin: 18px 22px 0;
  background: var(--paper-alt);
  border: 1.5px solid var(--plan-ink);
  border-radius: 14px;
  overflow: hidden;
}
.service-header summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.service-header summary::-webkit-details-marker { display: none; }
.service-header summary::after {
  content: '';
  width: 0;
  height: 0;
  margin-left: auto;
  border: 5px solid transparent;
  border-top-color: var(--plan-ink-55);
  border-bottom: 0;
  transform: translateY(2px);
  transition: transform .2s;
}
.service-header[open] summary::after { transform: rotate(180deg); }
.sh-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--plan-ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sh-icon .mo {
  font-size: 9px;
  letter-spacing: 1.2px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 5px;
}
.sh-icon .day {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sh-text { min-width: 0; flex: 1 1 auto; }
.sh-text .label {
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--plan-ink-55);
  font-weight: 700;
}
.sh-text .value {
  font-size: 16px;
  font-weight: 600;
  color: var(--plan-ink);
  margin-top: 2px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sh-body {
  padding: 4px 16px 18px;
  border-top: 1px solid var(--plan-rule-soft);
}
.sh-field { margin-top: 14px; }
.sh-field .sf-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--plan-ink-55);
  font-weight: 700;
  margin-bottom: 6px;
}
.sh-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--plan-rule);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--plan-ink);
  letter-spacing: -0.1px;
  font-family: inherit;
}
.sh-input:focus {
  outline: none;
  border-color: var(--plan-accent);
  box-shadow: 0 0 0 3px var(--plan-accent-soft);
}
.sh-helper {
  font-size: 12px;
  color: var(--plan-ink-55);
  margin-top: 6px;
  line-height: 1.4;
}
.sh-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}
.sh-trash {
  width: 32px;
  height: 32px;
}

/* --- Section head --- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 22px 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: 11.5px;
  letter-spacing: 1.6px;
  font-weight: 700;
  color: var(--plan-ink-55);
  text-transform: uppercase;
  margin: 0;
  font-family: inherit;
}
.section-head .actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.ghost-btn {
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--plan-rule);
  border-radius: 8px;
  color: var(--plan-ink-70);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.05px;
  transition: background .15s;
}
.ghost-btn:hover { background: var(--paper-alt); }

/* --- Items --- */
.items {
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.items .item {
  background: var(--paper-alt);
  border: 1px solid var(--plan-rule-soft);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
  padding: 0;
}
.items .item:hover { border-color: var(--plan-rule); }
.items .item.is-open {
  box-shadow: var(--plan-shadow-card);
  border-color: var(--plan-rule);
}
.item-head {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 8px;
  cursor: pointer;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.grip {
  width: 24px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--plan-ink-35);
  cursor: grab;
  flex-shrink: 0;
}
.grip:active { cursor: grabbing; }
.grip svg { width: 10px; height: 18px; }
.type-badge {
  font-size: 9.5px;
  letter-spacing: 1.6px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--plan-ink-70);
  border: 1px solid var(--plan-rule);
  flex-shrink: 0;
  white-space: nowrap;
}
.type-badge.song {
  color: var(--plan-accent-ink);
  border-color: #C8DDD9;
  background: var(--plan-accent-soft);
}
.type-badge.scripture {
  color: #76561A;
  border-color: #EFE2C0;
  background: #F8EFD7;
}
.type-badge.note { color: var(--plan-ink-70); }
.item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--plan-ink);
  letter-spacing: -0.2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-title .meta {
  font-weight: 500;
  color: var(--plan-ink-55);
  margin-left: 6px;
}
.chevron {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--plan-ink-55);
  transition: transform .2s;
}
.item.is-open .chevron { transform: rotate(180deg); }
.chevron svg { width: 12px; height: 8px; }

.item-body {
  padding: 4px 16px 18px 16px;
  border-top: 1px solid var(--plan-rule-soft);
  display: none;
}
.item.is-open .item-body { display: block; }
.field { margin-top: 14px; }
.field-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--plan-ink-55);
  font-weight: 700;
  margin-bottom: 6px;
}
.field .input {
  width: 100%;
  padding: 11px 13px;
  background: var(--paper);
  border: 1px solid var(--plan-rule);
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--plan-ink);
  letter-spacing: -0.05px;
  font-family: inherit;
}
.field .input:focus {
  outline: none;
  border-color: var(--plan-accent);
  box-shadow: 0 0 0 3px var(--plan-accent-soft);
}
.lyrics-area {
  width: 100%;
  padding: 13px;
  background: var(--paper);
  border: 1px solid var(--plan-rule);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.55;
  min-height: 180px;
  color: var(--plan-ink);
  letter-spacing: -0.05px;
  font-family: inherit;
  resize: vertical;
}
.lyrics-area:focus {
  outline: none;
  border-color: var(--plan-accent);
  box-shadow: 0 0 0 3px var(--plan-accent-soft);
}
.helper {
  font-size: 12px;
  color: var(--plan-ink-55);
  margin-top: 6px;
  line-height: 1.4;
}
.helper strong { color: var(--plan-ink); font-weight: 600; }
.item-toolbar {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--plan-rule-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toolbar-left { display: flex; gap: 6px; }
.icon-action {
  width: 32px;
  height: 32px;
  border: 1px solid var(--plan-rule);
  border-radius: 8px;
  background: transparent;
  color: var(--plan-ink-70);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.icon-action.danger {
  color: var(--plan-danger);
  border-color: #E9C7C7;
}
.icon-action svg { width: 14px; height: 14px; }
.done-btn {
  padding: 8px 14px;
  background: var(--plan-ink);
  color: var(--paper);
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.05px;
}

/* --- Add item row (sticky bottom dock) --- */
.add-item {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(247,246,243,0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--plan-rule);
  padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
  margin: 0;
  z-index: 20;
}
.add-item-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  width: 100%;
}
.add-chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 12px;
  background: var(--paper-alt);
  border: 1px solid var(--plan-rule);
  border-radius: 10px;
  color: var(--plan-ink);
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: -0.05px;
}
.add-chip:hover {
  background: #fff;
  border-color: var(--plan-ink-35);
}
.add-chip:active {
  transform: translateY(1px);
}
.add-chip .plus {
  color: var(--plan-accent);
  font-weight: 800;
  font-size: 16px;
}

/* --- Status line --- */
.status-line {
  padding: 18px 22px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--plan-ink-55);
  font-weight: 500;
  flex-wrap: wrap;
}
.status-line .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--plan-ink-35);
  flex-shrink: 0;
}
.status-line .status-dot[data-state="live"]      { background: var(--plan-live); }
.status-line .status-dot[data-state="scheduled"] { background: var(--plan-accent); }
.status-line .status-dot[data-state="past"]      { background: var(--plan-ink-35); }
.status-line .save-status[data-state="saving"] { color: var(--plan-draft); }
.status-line .save-status[data-state="dirty"] { color: var(--plan-ink-55); }
.status-line .save-status[data-state="saved"] { color: var(--plan-ink-70); }

/* --- Bottom action bar --- */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(247,246,243,0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--plan-rule);
  padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  z-index: 20;
}
.bottom-bar-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  width: 100%;
}
.secondary-btn {
  flex: 1;
  padding: 13px;
  background: transparent;
  color: var(--plan-ink);
  border: 1px solid var(--plan-rule);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.05px;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.primary-btn {
  flex: 1.4;
  padding: 13px;
  background: var(--plan-ink);
  color: var(--paper);
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.05px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.primary-btn .primary-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--plan-live);
}

/* --- Sortable visual states (keep existing classes working) --- */
.items .item-card-ghost {
  opacity: .35;
  background: var(--plan-rule-soft);
}
.items .item-card-chosen {
  box-shadow: var(--plan-shadow-card);
}
