:root {
  color-scheme: light;
  --ink: #241a30;
  --muted: #62586c;
  --plum: #4a3263;
  --deep: #251b32;
  --line: #e6dfeb;
  --paper: #f8f6fa;
  --lavender: #f0e8f7;
  --amber: #fff0d7;
  --green: #e5f3ea;
  font: 100%/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #9161b2; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font: 600 clamp(2.15rem, 4.5vw, 3.45rem)/1.1 Georgia, serif; letter-spacing: -.035em; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; line-height: 1.35; overflow-wrap: anywhere; }
main:focus, #editor-title:focus { outline: none; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 3; background: #fff; padding: .6rem 1rem; }

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--deep); color: #fff; display: flex; flex-direction: column; padding: 28px 18px 21px; }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; padding: 3px 9px 30px; }
.brand-mark { display: grid; place-items: center; flex: 0 0 43px; height: 43px; border: 1px solid #776087; border-radius: 11px; background: #3b2a4a; color: #f3ce90; font-size: 1.45rem; }
.brand strong, .brand small { display: block; }
.brand strong { font: 600 1.22rem Georgia, serif; letter-spacing: .045em; }
.brand small { color: #cec1da; font-size: .86rem; }
nav { display: grid; gap: 6px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 10px 11px; color: #e4d9ec; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-weight: 600; }
nav a:hover, nav [aria-current] { background: #443252; color: #fff; }
nav [aria-current] { border-color: #634b73; }
.nav-icon { width: 21px; color: #f3ce90; text-align: center; font-size: 1.16rem; }
.sidebar-foot { display: grid; margin-top: auto; padding: 20px 10px 5px; color: #cec1da; gap: 3px; font-size: .88rem; }
.sidebar-foot strong { color: #f3edf8; }
.side-divider { display: block; height: 1px; margin-bottom: 13px; background: #564362; }
.workspace { min-width: 0; }
.topbar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(16px, 4vw, 52px); background: #fff; border-bottom: 1px solid var(--line); font-weight: 650; }
.demo-pill, .count-pill, .status-badge { display: inline-block; border-radius: 999px; padding: 4px 10px; font-size: .875rem; font-weight: 650; }
.demo-pill { background: var(--amber); color: #654617; text-align: center; }
main { max-width: 1440px; margin: auto; padding: 32px clamp(16px, 4vw, 52px) 45px; }
.warning { background: var(--amber); color: #5b3b05; padding: 10px clamp(16px, 4vw, 52px); }
.hero { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; min-height: 210px; padding: 28px clamp(22px, 4vw, 44px); border-radius: 21px; background: linear-gradient(112deg, #30213c, #513561 78%, #694a79); color: #fff; }
.hero-copy { position: relative; z-index: 1; }
.hero .eyebrow { color: #f5d197; }
.eyebrow { margin-bottom: 9px; text-transform: uppercase; letter-spacing: .12em; font-size: .875rem; font-weight: 700; color: var(--plum); }
.hero-copy h1 + p { margin-top: 13px; color: #f2e7f7; }
.hero-dot { padding-inline: .33em; }
.hero-symbol { position: absolute; right: 9%; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 158px; height: 158px; border: 1px solid #b894a8; border-radius: 50%; color: #f3d6a6; font-size: 4rem; }
.hero-symbol::before, .hero-symbol::after { position: absolute; content: ""; inset: -13px; border-radius: 50%; border: 1px solid #b894a864; }
.hero-symbol::after { inset: 10px; border-style: dashed; }
.page-heading { margin: 2px 0 26px; }
.page-heading h1 + p { margin-top: 9px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; min-width: 0; }
.metric-icon, .event-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; font-weight: 700; font-size: 1.15rem; }
.birthday { background: var(--lavender); color: #55336a; }
.anniversary { background: var(--amber); color: #725018; }
.complete { background: var(--green); color: #275c3e; }
.metric strong { display: block; font-size: 1.42rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric strong small, .metric div > span { color: var(--muted); font-size: .875rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(248px, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 16px; }
.panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.panel-head { padding: 17px 19px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.panel-head p { color: var(--muted); margin-top: 3px; font-size: .9rem; }
.count-pill { flex-shrink: 0; background: #f4eff7; color: var(--plum); }
.roster, .agenda, .directory { list-style: none; padding: 0; margin: 0; }
.roster-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 15px 18px; }
.roster-row + .roster-row, .agenda li + li { border-top: 1px solid #f0ebf2; }
.prayer-info { display: grid; gap: 2px; overflow-wrap: anywhere; }
.prayer-info > strong { line-height: 1.35; }
.event-type { width: fit-content; background: transparent; font-weight: 700; font-size: .875rem; }
.ritual { color: var(--muted); font-size: .875rem; }
.ritual strong { color: var(--ink); font-weight: 600; }
.status-control { align-self: center; }
.status-control select { font-size: .875rem; width: 116px; }
select.performed { background-color: var(--green); color: #275c3e; }
select.skipped { color: #655269; background-color: #f4eef6; }
.agenda-item { display: grid; grid-template-columns: 58px 1fr; gap: 10px; width: 100%; align-items: center; background: transparent; border: 0; padding: 10px 18px; text-align: left; color: var(--ink); }
.agenda-item:hover, .member-item:hover { background: #f8f3fb; }
.agenda-item time { padding: 4px; background: #f5f0f8; border-radius: 6px; text-align: center; font-weight: 650; color: var(--plum); font-size: .875rem; }
.agenda-item strong, .agenda-item small { display: block; overflow-wrap: anywhere; }
.agenda-item small { font-size: .875rem; color: var(--muted); }
.panel-link { display: block; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--plum); font-weight: 650; font-size: .9rem; text-underline-offset: 3px; }
.review-callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: #fcf1df; border: 1px solid #efdab6; border-radius: 13px; }
.review-callout p, .review-callout a { font-size: .9rem; }
.review-callout a { color: #654617; font-weight: 650; text-underline-offset: 3px; }
.empty { padding: 20px 18px; color: var(--muted); }

.calendar-layout { display: grid; gap: 16px; }
.month-head { align-items: center; flex-wrap: wrap; }
.month-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; padding: 12px; }
.weekday { text-align: center; font-size: .875rem; font-weight: 650; color: var(--muted); }
.calendar-day { min-height: 54px; border: 1px solid var(--line); border-radius: 9px; display: grid; align-content: start; justify-items: start; gap: 2px; text-align: left; padding: 6px 8px; background: #fff; color: var(--ink); }
.calendar-day:hover { background: #faf4fd; }
.calendar-day small { color: var(--plum); font-size: .875rem; font-weight: 650; }
.calendar-day.is-today { border-color: #9272a3; }
.calendar-day[aria-pressed="true"] { background: var(--lavender); border-color: var(--plum); font-weight: 750; }
.calendar-blank { border-radius: 9px; background: #f9f7fa; }

.member-layout { display: grid; grid-template-columns: minmax(235px, .8fr) minmax(0, 1.65fr); align-items: start; gap: 17px; }
.directory-tools, .member-form { padding: 16px 18px; display: grid; gap: 12px; }
.directory-tools { border-bottom: 1px solid var(--line); }
.member-item { width: 100%; border: 0; background: #fff; padding: 8px 15px; display: flex; gap: 10px; text-align: left; color: var(--ink); align-items: center; }
.member-item.selected { background: #f4eaf9; box-shadow: inset 3px 0 var(--plum); }
.directory li:last-child button { border-radius: 0 0 15px 15px; }
.member-item strong, .member-item small { display: block; overflow-wrap: anywhere; }
.member-item small { font-size: .875rem; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; background: var(--lavender); color: var(--plum); font-weight: 650; font-size: .875rem; }
.verified { color: #2c6242; }
.needs-review { color: #7a4e0c; }
.status-badge.verified { background: var(--green); }
.status-badge.needs-review { background: var(--amber); }
.status-badge { flex-shrink: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label, legend { color: var(--ink); font-weight: 650; font-size: .9rem; }
label { display: grid; gap: 4px; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; min-height: 41px; border: 1px solid #cfc3d6; border-radius: 8px; background: #fff; padding: 7px 9px; color: var(--ink); font-weight: 400; }
select { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, #675775 50%), linear-gradient(135deg, #675775 50%, transparent 50%); background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; }
.date-fields { min-width: 0; margin: 0; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 8px; }
.date-fields legend { padding-inline: 4px; }
.form-note { color: var(--muted); font-size: .875rem; }
.form-error { color: #8b263a; background: #fcebef; border-radius: 8px; padding: 8px 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.button { display: inline-flex; align-items: center; min-height: 41px; border-radius: 8px; padding: 7px 11px; font-size: .875rem; font-weight: 650; }
.button.subtle { background: #fff; border: 1px solid #cfc3d6; color: var(--plum); }
.button.subtle:hover { background: #f4eef8; }
.button.primary { background: var(--plum); border: 1px solid var(--plum); color: #fff; }
.button.primary:hover { background: #603c78; }
.toast { position: fixed; z-index: 2; right: 20px; bottom: 20px; max-width: calc(100vw - 40px); border: 1px solid #685576; border-radius: 9px; background: var(--deep); color: #fff; padding: 10px 14px; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .stack { grid-template-columns: minmax(0, 1.2fr) minmax(220px, 1fr); align-items: start; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { padding: 12px 14px; }
  .brand { padding: 0 0 10px; }
  .brand-mark { flex-basis: 37px; height: 37px; }
  nav { display: flex; flex-wrap: wrap; }
  nav a { padding: 6px 8px; font-size: .875rem; gap: 4px; }
  .sidebar-foot { display: none; }
  .topbar { min-height: 52px; font-size: .9rem; }
  main { padding-top: 19px; }
  .hero { min-height: 159px; }
  .hero-symbol { right: -29px; width: 126px; height: 126px; opacity: .24; }
}
@media (max-width: 530px) {
  .metrics { gap: 6px; margin: 12px 0; }
  .metric { display: block; padding: 8px; }
  .metric .metric-icon { width: 29px; height: 29px; margin-bottom: 4px; }
  .metric strong { font-size: 1.17rem; }
  .metric div > span { line-height: 1.2; display: block; margin-top: 4px; }
  .stack, .member-layout { grid-template-columns: 1fr; }
  .directory { max-height: 245px; overflow: auto; }
  .roster-row { grid-template-columns: auto minmax(0, 1fr); padding-inline: 13px; }
  .status-control { grid-column: 2; }
  .panel-head { padding: 13px; }
  .count-pill { display: none; }
  .calendar-grid { padding: 8px; gap: 3px; }
  .calendar-day { min-height: 48px; padding: 4px; justify-items: center; }
  .date-count-label { display: none; }
  .directory-tools, .member-form { padding-inline: 13px; }
}
