:root {
  --bg: #F1F4F9; --card: #FFFFFF; --ink: #152033; --ink2: #3A4658; --muted: #566273;
  --soft: #F5F7FB; --soft2: #EDF1F7; --navy: #0F2742; --line: #C3CBD8; --danger: #8A1C1C;
  --shadow: 0 1px 2px rgba(15,39,66,.06), 0 8px 24px rgba(15,39,66,.07);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; font-size: 15px; line-height: 1.45; }
h1, h2, .brand-name, .datebox strong, .mark { font-family: 'Plus Jakarta Sans', Inter, system-ui, sans-serif; letter-spacing: -0.01em; }
h2 { margin: 0 0 14px; font-size: 18px; font-weight: 800; }
a { color: #1D4C8F; } a:hover { color: #12335F; }
a:focus-visible, button:focus-visible, input:focus, select:focus { outline: 3px solid #8DB4EA; outline-offset: 1px; }
.sub { color: var(--ink2); font-size: 13px; margin: 0; }
.meta { color: var(--muted); font-size: 13px; }
.meta.small { font-size: 12px; }

/* Header */
.top { background: var(--navy); color: #fff; padding: 22px 20px 60px; }
.top-in { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 14px; align-items: center; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-icon { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; background: #1E4572; display: flex; align-items: center; justify-content: center; }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-name { font-size: 24px; font-weight: 800; line-height: 1.15; }
.brand-tag { font-size: 14px; color: #C5D3E4; }
.top-nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.top-nav form { margin: 0; }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.pill-white { background: #fff; color: var(--navy); border: 0; } .pill-white:hover { color: var(--navy); background: #E8EEF6; }
.pill-ghost { background: transparent; color: #fff; border: 1px solid #8FA6C2; }

/* Layout */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px 48px; display: flex; flex-direction: column; gap: 20px; }
.wrap.lift { margin-top: -40px; }
.wrap.narrow { max-width: 440px; }
.wrap.columns { flex-direction: row; }
.columns { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-side { flex: 1 1 330px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-form { flex: 1 1 340px; min-width: 0; }
.col-list { flex: 999 1 520px; min-width: 0; }
.card { background: var(--card); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.h-card { margin: 0 0 6px; font-size: 22px; font-weight: 800; }

/* Summary cards */
.highlights { display: flex; flex-wrap: wrap; gap: 16px; }
.highlight { flex: 1 1 250px; min-width: 0; display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 16px; }
.mark { flex: 0 0 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; }
.highlight-text { min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.highlight-title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Congregation filter */
.segment { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; background: var(--card); border-radius: 26px; padding: 5px; box-shadow: 0 1px 2px rgba(15,39,66,.08); }
.seg { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
.seg.on, .seg.on:hover { background: var(--navy); color: #fff; }

/* Event type colours */
.t-wedding  { --t-bg: #FCE8F0; --t-fg: #8A1C45; --t-dot: #C2296A; }
.t-school   { --t-bg: #E5EEFB; --t-fg: #1D4C8F; --t-dot: #2563A8; }
.t-cleaning { --t-bg: #E1F4EB; --t-fg: #0F5C3C; --t-dot: #12805C; }
.t-change   { --t-bg: #FFF0D6; --t-fg: #6B4100; --t-dot: #B26A00; }
.t-other    { --t-bg: #ECEEF2; --t-fg: #3A4553; --t-dot: #5B6676; }
.mark, .chip, .datebox { background: var(--t-bg); color: var(--t-fg); }
.dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 999px; background: var(--t-dot); display: inline-block; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.month { margin: 0; font-size: 22px; font-weight: 800; }
.cal-nav { display: flex; gap: 8px; }
.round { width: 44px; height: 44px; border-radius: 999px; background: var(--soft2); color: var(--navy); font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.scroll-x { overflow-x: auto; }
.cal { min-width: 640px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wd { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 8px; }
.day { min-height: 98px; border-radius: 12px; padding: 7px; display: flex; flex-direction: column; gap: 4px; background: var(--soft); }
.day.weekend { background: #EEF2F8; }
.day.out { background: #FAFBFD; }
.num { width: 28px; height: 28px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.day.out .num { color: #6B7686; }
.day.today .num { background: var(--navy); color: #fff; }
.chip { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; line-height: 1.3; padding: 4px 6px; border-radius: 6px; }
.chip .dot { flex-basis: 6px; width: 6px; height: 6px; }
.chip-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { font-size: 11px; font-weight: 600; color: var(--muted); padding-left: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink2); }

/* Lists and tiles */
.list { display: flex; flex-direction: column; gap: 14px; }
.item { display: flex; gap: 14px; align-items: flex-start; }
.datebox { flex: 0 0 58px; border-radius: 12px; padding: 7px 0; text-align: center; display: flex; flex-direction: column; }
.datebox span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.datebox strong { font-size: 20px; font-weight: 800; line-height: 1.15; }
.item-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-top: 2px; }
.item-text.grow { flex: 1 1 220px; }
.type { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--t-fg); }
.item-title { font-size: 15px; font-weight: 700; }
.tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.tile { flex: 1 1 180px; display: flex; gap: 12px; align-items: center; background: var(--soft); border-radius: 12px; padding: 12px; font-size: 14px; }
.tile-row { justify-content: space-between; flex: 0 0 auto; }
.tile-wrap { flex-wrap: wrap; flex: 0 0 auto; }
.roster { display: flex; flex-direction: column; gap: 10px; }
.avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 999px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.avatar.small { flex-basis: 32px; width: 32px; height: 32px; font-size: 13px; }
.avatars { display: flex; gap: 4px; }
.list-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.list-head h2 { margin: 0; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
input[type=text], input[type=password], input[type=date], input[type=time], select {
  font: inherit; font-size: 16px; min-height: 46px; width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #FBFCFD; color: var(--ink);
}
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--ink2); padding: 0; margin-bottom: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--navy); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { color: #fff; background: #17375C; }
.btn-quiet, .btn-quiet:hover { background: var(--soft2); color: var(--navy); }
.actions { display: flex; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.btn-small { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-small.danger { color: var(--danger); border-color: #D9B4B4; }
.alert { background: #FDECEC; color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; margin: 12px 0 0; }
.notice { background: #E1F4EB; color: #0F5C3C; border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; margin: 12px 0 0; }
.setup-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.setup-box { flex: 1 1 260px; flex-direction: column; align-items: stretch; padding: 16px; }
.setup-box legend { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); float: left; width: 100%; margin-bottom: 4px; }

@media (max-width: 560px) {
  .brand-tag { display: none; }
  .brand-name { font-size: 20px; }
  .pair { grid-template-columns: minmax(0, 1fr); }
}
