/* Church Connect styles */

:root {
  --ink: #202e2a;
  --muted: #78817a;
  --green: #395d4c;
  --green-dark: #263c32;
  --green-soft: #e7eee8;
  --paper: #f7f6f2;
  --white: #fff;
  --line: #e9e8e2;
  --danger: #8b4d3f;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: var(--green); }
:focus-visible { outline: 2px solid #78947f; outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */

.layout { min-height: 100vh; display: grid; grid-template-columns: 246px 1fr; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 246px; z-index: 5;
  background: var(--white); border-right: 1px solid var(--line);
  padding: 27px 18px; display: flex; flex-direction: column; overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 34px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  display: block; object-fit: cover; background: #154062; box-shadow: 0 1px 3px #00000026;
}
.brand-name { font: 600 18px var(--serif); letter-spacing: -.3px; }
.brand-sub { font-size: 10px; color: var(--muted); margin-top: 2px; letter-spacing: .3px; }

.nav-label {
  font-size: 10px; color: #a2a7a0; text-transform: uppercase; letter-spacing: 1.4px;
  padding: 0 12px; margin: 6px 0 9px;
}
.nav { display: grid; gap: 4px; }
.nav button {
  border: 0; background: transparent; color: #707a73; text-align: left; font-size: 13px;
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px;
}
.nav button .ico { width: 17px; text-align: center; font-size: 16px; }
.nav button:hover, .nav button.active { background: var(--green-soft); color: var(--green); }
.nav button.active { font-weight: 600; }

.sidebar-spacer { flex: 1; }

.church-card {
  display: grid; gap: 4px; text-align: left; width: calc(100% - 8px);
  margin: 15px 4px 17px; padding: 14px;
  background: #f8f7f3; border: 1px solid var(--line); border-radius: 11px;
}
.church-card:hover { border-color: #cfd8cf; background: #f3f5f0; }
.church-card .tiny { font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.church-card strong { font-size: 12px; overflow-wrap: anywhere; }
.church-card-sub { font-size: 11px; color: var(--green); font-weight: 600; }

.profile {
  width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left;
  padding: 17px 5px 0; display: flex; align-items: center; gap: 10px;
}
.profile-copy { min-width: 0; flex: 1; }
.profile strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile small { font-size: 10px; color: var(--muted); }
.profile-chevron { color: #959b94; font-size: 18px; }
.profile:hover strong { color: var(--green); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: #dce7dc; color: var(--green); font-weight: 700;
}
.avatar-sm { width: 30px; height: 30px; font-size: 10px; border: 0; }
button.avatar:hover { background: #cfdfd0; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }

.main { grid-column: 2; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 4; height: 70px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 43px; border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 242, .92); backdrop-filter: blur(8px);
}
.crumb { font-size: 12px; color: var(--muted); }
.crumb strong { color: var(--ink); font-weight: 600; }
.crumb-sep { margin: 0 8px; color: #bbc0b8; }
.top-actions { display: flex; align-items: center; gap: 16px; }

.view-toggle { display: flex; background: #ecebe5; padding: 3px; border-radius: 7px; }
.view-toggle button {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 10px; border-radius: 5px; font-size: 11px;
}
.view-toggle button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #00000012; }

.notify-wrap { position: relative; }
.icon-button {
  position: relative; display: grid; place-items: center;
  border: 0; background: transparent; color: #68736c; padding: 6px; border-radius: 8px;
}
.icon-button:hover { background: #ecebe5; }
.dot { position: absolute; width: 7px; height: 7px; background: #c46a50; border: 1.5px solid var(--paper); border-radius: 50%; top: 5px; right: 5px; }

.popover {
  position: absolute; right: 0; top: calc(100% + 8px); width: 290px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 34px #263c321f; padding: 14px; z-index: 30;
}
.popover-head { font: 600 15px var(--serif); margin-bottom: 8px; }
.popover ul { list-style: none; margin: 0 0 10px; padding: 0; }
.popover li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.popover li:last-child { border-bottom: 0; }
.popover li span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }

.page { max-width: 1180px; margin: 0 auto; padding: 36px 43px 55px; outline: none; }

/* ---------- Shared pieces ---------- */

.eyebrow { font-size: 10px; color: var(--green); letter-spacing: 1.6px; text-transform: uppercase; font-weight: 700; }

.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 10px 0 22px; }
.page-title h1 { font: 600 31px var(--serif); margin: 6px 0 4px; }
.page-title p { margin: 0; color: var(--muted); font-size: 12px; }

.section-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 13px; }
.section-head h2 { font: 600 20px var(--serif); margin: 0; letter-spacing: -.2px; }

.button {
  border: 0; border-radius: 7px; padding: 10px 15px;
  background: var(--green); color: #fff; font-weight: 600; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; white-space: nowrap;
}
.button:hover { background: var(--green-dark); }
.button.light { background: #fff; color: var(--green); }
.button.light:hover { background: #f1f4f0; }
.button.outline { background: transparent; border: 1px solid #d8ddd8; color: var(--ink); }
.button.outline:hover { background: #fff; }
.button.danger { color: var(--danger); }
.button.small { padding: 7px 11px; font-size: 11px; }
.button.wide { width: 100%; padding: 12px 15px; font-size: 13px; }
.button:disabled:hover { background: var(--green); }
.button.outline:disabled:hover, .button.light:disabled:hover { background: transparent; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.text-link {
  color: var(--green); font-size: 11px; font-weight: 700; text-decoration: none;
  border: 0; background: none; padding: 0;
}
.text-link:hover { text-decoration: underline; }
.text-link.danger { color: var(--danger); }
.link-row { display: flex; flex-wrap: wrap; gap: 14px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 19px; }
.card + .card { margin-top: 13px; }
.card-title { font: 600 20px var(--serif); margin: 0 0 16px; }
.sub-title { font: 600 16px var(--serif); margin: 0 0 6px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-bottom: 14px; }
.rule { height: 1px; background: var(--line); margin: 16px 0; }
.notice { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 0; }
.reading { font-size: 13px; line-height: 1.8; color: #5f6b63; max-width: 680px; }
.block { margin-top: 27px; }
.footer-note { text-align: center; color: #9a9f98; font-size: 10px; margin-top: 32px; }

/* ---------- Home ---------- */

.hero {
  position: relative; overflow: hidden; display: flex; align-items: center;
  min-height: 224px; margin: 15px 0 29px; padding: 34px 38px;
  background: var(--green); color: #fff; border-radius: 15px;
}
.hero::after {
  content: '✦'; position: absolute; right: 11%; top: -84px;
  font-size: 270px; color: #ffffff0a; transform: rotate(14deg);
}
.hero-content { position: relative; z-index: 1; max-width: 570px; }
.hero .eyebrow { color: #c5d5c9; }
.hero h1 { font: 600 35px/1.2 var(--serif); letter-spacing: -.6px; margin: 10px 0; }
.hero p { font-size: 13px; line-height: 1.7; color: #d5e0d8; max-width: 440px; margin: 0 0 20px; }

.grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .9fr); gap: 22px; }

.service { display: flex; align-items: center; gap: 15px; }
.date-tile {
  width: 53px; height: 58px; flex: none; border-radius: 9px; background: #f3f2ec;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.date-tile span { font-size: 9px; text-transform: uppercase; color: #858a82; letter-spacing: 1px; }
.date-tile strong { font: 600 23px/1.15 var(--serif); }
.service-info { flex: 1; min-width: 0; }
.service-info strong { font-size: 13px; }
.service-info p { font-size: 11px; color: var(--muted); margin: 5px 0 0; }
.service .button { padding: 9px 12px; }
.details { display: flex; flex-wrap: wrap; gap: 10px 24px; color: #68736c; font-size: 11px; }

.ministry-title { font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.ministry-card p { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 5px 0 13px; }
.ministry-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.people { display: flex; padding-left: 5px; }
.people i {
  font-style: normal; width: 23px; height: 23px; border-radius: 50%; margin-left: -5px;
  border: 2px solid #fff; background: #e6c8ac; color: #5b4a3f;
  display: grid; place-items: center; font-size: 8px;
}
.people i:nth-child(2) { background: #d7dfc6; }
.people i:nth-child(3) { background: #d9cce1; }

.event-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.event-list.full { grid-template-columns: repeat(2, 1fr); }
.event-card {
  display: flex; gap: 12px; min-height: 102px; padding: 15px;
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
}
.event-date {
  width: 42px; height: 48px; flex: none; border-radius: 7px; background: #f5f2eb;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.event-date span { font-size: 9px; color: #9b7650; letter-spacing: .7px; }
.event-date b { font: 600 20px var(--serif); }
.event-body { min-width: 0; }
.event-card h3 { font-size: 12px; margin: 1px 0 6px; overflow-wrap: anywhere; }
.event-card p { font-size: 10px; color: var(--muted); margin: 0 0 7px; line-height: 1.6; overflow-wrap: anywhere; }
.event-card p.event-going { color: var(--green); font-weight: 600; margin-bottom: 8px; }
.event-body .row-actions { flex-wrap: wrap; gap: 10px; }
.lower { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; margin-top: 28px; }

.sermon-card { display: flex; gap: 15px; align-items: center; }
.play {
  width: 95px; height: 76px; flex: none; border: 0; border-radius: 8px;
  background: linear-gradient(140deg, #829482, #344c3d); color: #fff;
  display: grid; place-items: center; font-size: 23px;
}
.play:hover { filter: brightness(1.08); }
.play.mini { width: 53px; height: 50px; font-size: 17px; }
.sermon-card.featured { padding: 24px; margin-bottom: 26px; }
.sermon-card.featured .play { width: 130px; height: 102px; font-size: 30px; }
.sermon-copy small { font-size: 9px; text-transform: uppercase; color: var(--green); letter-spacing: 1px; font-weight: 700; }
.sermon-copy h3 { font: 600 17px var(--serif); margin: 5px 0; }
.sermon-copy p { font-size: 10px; color: var(--muted); margin: 0 0 8px; }

.verse { background: #f0f2eb; border: 0; position: relative; overflow: hidden; }
.verse::after {
  content: '“'; position: absolute; right: 14px; bottom: -55px;
  font: 170px var(--serif); color: #395d4c0d;
}
.verse blockquote { font: 500 17px/1.5 var(--serif); margin: 12px 0 9px; max-width: 600px; }
.verse cite { font-style: normal; color: var(--green); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.verse-lg { padding: 30px; }
.verse-lg blockquote { font-size: 24px; }

/* ---------- Forms & admin ---------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: grid; gap: 6px; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid #e4e5df; border-radius: 7px; padding: 10px;
  background: #fff; outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: #78947f; }
.field textarea { min-height: 110px; resize: vertical; }
.check { font-size: 12px; display: flex; gap: 8px; align-items: center; }
.check input { accent-color: var(--green); width: 16px; height: 16px; }

.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 18px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 17px; }
.stat small { color: var(--muted); font-size: 10px; }
.stat strong { display: block; font: 600 25px var(--serif); margin-top: 6px; }
.admin-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 12px;
}
.admin-row:last-child { border-bottom: 0; }
.admin-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 12px; align-items: center; flex: none; }
.status { font-size: 10px; background: var(--green-soft); color: var(--green); padding: 5px 8px; border-radius: 20px; white-space: nowrap; }
.status.muted { background: #f0efea; color: var(--muted); }
.quote { color: var(--ink); font-size: 12px; }
.role-select { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 6px 8px; font-size: 11px; }
.admin-form { padding: 16px; margin-bottom: 8px; background: #f8f8f4; border-radius: 10px; }
.code-chip { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; color: var(--green); }

.invite-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 22px 26px; border-radius: 14px; background: var(--green); color: #fff;
}
.invite-card .eyebrow { color: #c5d5c9; }
.invite-card p { margin: 0; color: #d5e0d8; font-size: 12px; }
.invite-code { font: 700 32px ui-monospace, Consolas, monospace; letter-spacing: 6px; margin: 4px 0 6px; }

/* ---------- Churches & profile ---------- */

.welcome-panel {
  display: flex; align-items: center; gap: 12px; margin: 52px 0 14px;
  padding: 18px 20px 18px 6px; border-radius: 18px;
  border: 1px solid #395d4c1f; box-shadow: 0 8px 24px #395d4c14;
  background:
    radial-gradient(circle at 16% 70%, #ffffffb3, transparent 42%),
    linear-gradient(135deg, #395d4c2e, #78947f1a 55%, #e8c25a24);
}
.mascot {
  flex: none; align-self: flex-end; width: 170px; height: auto; margin: -60px 0 -18px;
  filter: drop-shadow(0 6px 10px #395d4c33); transform-origin: 50% 100%;
  animation: mascot-breathe 3.2s ease-in-out infinite;
}
@keyframes mascot-breathe { 50% { transform: scale(1.025); } }
@media (prefers-reduced-motion: reduce) { .mascot { animation: none; } }
.mascot-bubble {
  position: relative; flex: 1; min-width: 0; padding: 14px 16px;
  background: #ffffffd9; border: 1px solid #ffffff; border-radius: 14px;
  box-shadow: 0 4px 16px #395d4c1a; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.mascot-bubble::before {
  content: ''; position: absolute; left: -9px; top: 50%; width: 9px; height: 18px;
  background: #ffffffd9; transform: translateY(-50%); clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
.mascot-title { font: 700 15px var(--sans); color: var(--green); margin: 0 0 4px; }
.mascot-bubble p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink); }
.inline-form { display: flex; gap: 8px; }
.inline-form input {
  flex: 1; min-width: 0; border: 1px solid #e4e5df; border-radius: 7px; padding: 10px 12px; outline: none;
  font: 600 16px ui-monospace, Consolas, monospace; letter-spacing: 3px; text-transform: uppercase;
}
.inline-form input:focus { border-color: #78947f; }
.search-field { margin: 0 0 10px; }
.church-results { display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.church-result { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.church-result:last-child { border-bottom: 0; }
.church-avatar {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 12px;
}
.church-result-copy { flex: 1; min-width: 0; }
.church-result-copy strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.church-result-copy span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-head strong { display: block; font: 600 18px var(--serif); }

/* ---------- Loading & sign-in ---------- */

.loading-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center; color: var(--muted);
}
.loading-screen .brand-mark { width: 64px; height: 64px; border-radius: 16px; animation: pulse 1.4s ease-in-out infinite; }
.loading-screen p { max-width: 420px; line-height: 1.6; margin: 0; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.94); } }

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; background: var(--green); color: #fff;
  padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.auth-hero::after { content: '✦'; position: absolute; right: -40px; bottom: -120px; font-size: 380px; color: #ffffff0a; }
.auth-hero .brand { position: absolute; top: 40px; left: 56px; padding: 0; }
.auth-hero .brand-sub { color: #c5d5c9; }
.auth-hero h1 { font: 600 40px/1.15 var(--serif); letter-spacing: -.6px; margin: 0 0 14px; max-width: 480px; }
.auth-hero p { color: #d5e0d8; font-size: 14px; line-height: 1.7; max-width: 440px; margin: 0 0 18px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: #e6eee8; font-size: 13px; position: relative; z-index: 1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-tabs { display: flex; background: #ecebe5; padding: 4px; border-radius: 9px; margin-bottom: 26px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.auth-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #00000014; }
.auth-form { display: grid; gap: 14px; }
.auth-form h2 { font: 600 27px var(--serif); margin: 0; }
.auth-form > .notice { margin-top: -8px; font-size: 12px; }
.auth-form .field input { padding: 12px; font-size: 14px; }
.password-field { position: relative; }
.password-field input { padding-right: 58px !important; }
.password-field .text-link { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.auth-row { display: flex; justify-content: flex-end; margin-top: -6px; }
.auth-switch { text-align: center; font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.auth-switch .text-link { font-size: 12px; }
.form-error, .form-success { margin: 0; padding: 10px 12px; border-radius: 7px; font-size: 12px; line-height: 1.5; }
.form-error { background: #f8e9e4; color: #8b3e2c; }
.form-success { background: var(--green-soft); color: var(--green); }
.demo-note { margin-top: 22px; padding: 13px 14px; border: 1px dashed #cdd6cd; border-radius: 9px; font-size: 11px; line-height: 1.7; color: #66716a; }

/* ---------- Bible ---------- */

.bible-toolbar { display: grid; grid-template-columns: 1fr 1.5fr 1fr .6fr; gap: 10px; max-width: 900px; margin: 0 auto; }
.select-field { display: grid; gap: 5px; font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
.select-field select {
  width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #fff;
  padding: 10px 12px; color: var(--ink); font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none;
}
.bible-passage {
  max-width: 780px; margin: 20px auto; padding: 30px 38px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.bible-passage h2 { font: 600 24px var(--serif); margin: 0 0 6px; }
.translation-label { color: var(--muted); font-size: 11px; margin-bottom: 22px; }
.bible-heading { font: 600 15px var(--serif); color: var(--green); margin: 22px 0 8px; }
.bible-verse { font: 400 16px/1.85 var(--serif); margin: 0 0 10px; }
.bible-verse sup { font: 700 10px var(--sans); color: var(--green); margin-right: 7px; }
.bible-verse .poem { display: block; padding-left: 18px; }
.bible-verse .poem-2 { padding-left: 36px; }
.woj { color: #8f3b2c; }
.bible-status { color: var(--muted); font-size: 12px; line-height: 1.7; padding: 18px 0; }
.bible-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; max-width: 780px; margin: 0 auto; }
.bible-credit { font-size: 10px; color: #8a918a; line-height: 1.6; max-width: 780px; margin: 16px auto 0; text-align: center; }

/* ---------- Notes ---------- */

.notes-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.notes-sidebar {
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  display: flex; flex-direction: column; min-height: 600px; overflow: hidden;
}
.notes-sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 17px 16px 12px; }
.notes-sidebar-heading strong { display: block; font: 600 16px var(--serif); }
.notes-sidebar-heading small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.notes-search {
  margin: 0 12px 10px; height: 38px; display: flex; gap: 8px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; color: #829087;
}
.notes-search input { min-width: 0; width: 100%; border: 0; outline: none; background: transparent; font-size: 12px; }
.notes-list { padding: 4px 8px 10px; overflow: auto; flex: 1; max-height: 520px; }
.note-item {
  width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left;
  padding: 12px 10px; margin-bottom: 3px; background: transparent;
  border: 1px solid transparent; border-radius: 8px;
}
.note-item:hover { background: #f8f8f5; }
.note-item.active { background: #edf2ed; border-color: #e1e9e2; }
.note-item-icon {
  flex: none; width: 29px; height: 29px; border-radius: 7px;
  display: grid; place-items: center; background: #f0f3ef; color: var(--green); font-size: 13px;
}
.note-item-copy { min-width: 0; flex: 1; }
.note-item-copy strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item-copy small { display: block; font-size: 10px; line-height: 1.6; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.note-reference { color: var(--green); font-weight: 600; }
.notes-list-empty { padding: 18px 12px; font-size: 11px; line-height: 1.6; color: var(--muted); text-align: center; }

.notes-editor {
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  padding: 22px 28px; min-height: 600px; display: flex; flex-direction: column;
  box-shadow: 0 5px 20px #263c3208;
}
.notes-editor-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid #f0f0ec;
  font-size: 10px; color: #8a938c;
}
.autosave { display: flex; align-items: center; gap: 7px; color: #66736a; }
.autosave i { width: 7px; height: 7px; border-radius: 50%; background: #6e9b78; }
.note-title-input {
  width: 100%; border: 0; outline: none; padding: 8px 0; background: transparent;
  font: 600 27px var(--serif);
}
.note-title-input::placeholder, .note-ref-field input::placeholder { color: #b0b6af; }
.note-ref-field { display: flex; align-items: center; gap: 13px; border-bottom: 1px solid #f0f0ec; padding: 8px 0 12px; }
.note-ref-field span { flex: none; color: #89928b; font-size: 9px; font-weight: 700; letter-spacing: 1.2px; }
.note-ref-field input { border: 0; outline: none; background: transparent; color: var(--green); font-size: 12px; width: 100%; }

.rich-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 9px 0; border-bottom: 1px solid #f0f0ec; }
.rich-toolbar button {
  min-width: 31px; min-height: 31px; padding: 5px 8px; font-size: 12px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: #4d5b52;
}
.rich-toolbar button:hover { background: #eef2ed; border-color: #dfe7df; }
.rich-toolbar select {
  height: 31px; max-width: 130px; padding: 0 7px; font-size: 11px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #4b554e;
}
.toolbar-sep { width: 1px; height: 21px; background: var(--line); margin: 0 3px; }
.color-control {
  position: relative; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 6px;
  display: grid; place-items: center; font-weight: 700; color: var(--green); cursor: pointer;
}
.color-control input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.symbol-picker {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 8px;
  background: #f7f8f5; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px;
}
.symbol-picker button { width: 32px; height: 32px; border: 0; border-radius: 6px; background: #fff; color: var(--green); font-size: 16px; }
.symbol-picker button:hover { background: var(--green-soft); }

.note-rich-editor {
  flex: 1; min-height: 320px; margin-top: 16px; outline: none; overflow-wrap: anywhere;
  color: #35423a; font: 400 15px/1.85 var(--sans);
}
.note-rich-editor:empty::before { content: attr(data-placeholder); color: #a4aaa3; pointer-events: none; }
.note-rich-editor ul, .note-rich-editor ol { padding-left: 26px; }
.note-rich-editor h3 { font: 600 20px var(--serif); margin: 12px 0 6px; }
.note-rich-editor blockquote { border-left: 3px solid #c8d5ca; padding-left: 14px; color: #65746a; margin: 12px 0; }

.notes-editor-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-top: 1px solid #f0f0ec; padding-top: 15px; margin-top: 10px;
}
.notes-hint { color: #929a92; font-size: 10px; }
.notes-empty {
  background: #fff; border: 1px dashed #d9ded8; border-radius: 13px; min-height: 600px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px;
}
.notes-empty-icon {
  width: 52px; height: 52px; border-radius: 16px; margin-bottom: 14px;
  display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 23px;
}
.notes-empty h2 { font: 600 22px var(--serif); margin: 0 0 8px; }
.notes-empty p { max-width: 340px; color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0 0 17px; }

/* ---------- Toast & mobile nav ---------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; max-width: calc(100vw - 32px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s;
  background: var(--green-dark); color: #fff; border-radius: 8px; padding: 12px 17px; font-size: 12px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.mobile-head, .mobile-nav { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .layout { grid-template-columns: 210px 1fr; }
  .sidebar { width: 210px; }
  .topbar { padding: 0 25px; }
  .page { padding: 30px 25px; }
  .grid { grid-template-columns: 1fr; }
  .event-list { grid-template-columns: 1fr 1fr; }
  .bible-toolbar { grid-template-columns: 1fr 1fr; }
  .notes-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .notes-editor { padding: 20px; }
}

@media (max-width: 680px) {
  .layout { display: block; }
  .sidebar { display: none; }
  .main { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .topbar { height: 58px; padding: 0 16px; top: env(safe-area-inset-top, 0px); }
  .top-actions { gap: 8px; }
  .view-toggle button { padding: 6px 8px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 22px 30px; }
  .auth-hero .brand { position: static; margin-bottom: 26px; }
  .auth-hero h1 { font-size: 29px; }
  .auth-hero p { font-size: 13px; }
  .auth-points { display: none; }
  .auth-panel { padding: 28px 16px 40px; align-items: flex-start; }
  .invite-card { padding: 20px; }
  .invite-code { font-size: 26px; letter-spacing: 4px; }
  .mobile-head { display: flex; align-items: center; gap: 9px; }
  .mobile-head .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .mobile-head strong { font: 600 16px var(--serif); }
  .crumb { display: none; }
  .page { padding: 23px 16px; }

  .hero { padding: 25px 22px; margin-top: 14px; }
  .hero h1 { font-size: 30px; }
  .hero::after { right: -3%; font-size: 220px; }
  .page-title { flex-direction: column; align-items: flex-start; }
  .page-title h1 { font-size: 27px; }
  .service { flex-wrap: wrap; }
  .service-info { min-width: calc(100% - 72px); }
  .service .button { margin-left: 68px; }
  .details { flex-direction: column; }
  .event-list, .event-list.full { grid-template-columns: 1fr; }
  .lower { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 16px; }
  .sermon-card.featured { flex-direction: column; align-items: flex-start; }
  .sermon-card.featured .play { width: 100%; height: 150px; }
  .verse-lg blockquote { font-size: 20px; }
  .admin-grid { grid-template-columns: 1fr 1fr; }
  .admin-row { flex-direction: column; align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .welcome-panel { gap: 8px; margin-top: 44px; padding: 14px 14px 14px 2px; }
  .mascot { width: 128px; margin: -46px 0 -14px; }
  .mascot-bubble { padding: 12px 13px; }
  .mascot-bubble p { font-size: 12px; }

  .bible-toolbar { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bible-passage { padding: 23px 18px; }
  .bible-passage h2 { font-size: 21px; }
  .bible-verse { font-size: 15px; }

  .notes-layout { grid-template-columns: 1fr; gap: 12px; }
  .notes-sidebar { min-height: 0; }
  .notes-list { max-height: 220px; }
  .notes-editor { min-height: 500px; padding: 17px; }
  .notes-empty { min-height: 330px; }
  .note-title-input { font-size: 23px; }
  .note-rich-editor { min-height: 240px; }
  .notes-editor-footer { flex-direction: column; align-items: stretch; }
  .notes-editor-footer .button-row .button { flex: 1; }

  .mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
    display: flex; justify-content: space-around; align-items: center;
    height: calc(62px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff; border-top: 1px solid var(--line);
  }
  .mobile-nav button { display: grid; gap: 3px; place-items: center; background: none; border: 0; color: #80877f; font-size: 10px; }
  .mobile-nav button span { font-size: 18px; }
  .mobile-nav button.active { color: var(--green); font-weight: 700; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
