@font-face { font-family: 'Lato'; font-style: normal; font-weight: 300; font-display: swap; src: url('/static/fonts/lato-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/lato-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/lato-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 900; font-display: swap; src: url('/static/fonts/lato-latin-900-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 800; font-display: swap; src: url('/static/fonts/montserrat-latin-800-normal.woff2') format('woff2'); }
:root {
  --brand: #003399;
  --brand-dark: #002577;
  --accent: #377bb8;
  --accent-dark: #2a6399;
  --red: #d4000a;
  --red-dark: #a80008;
  --green: #00703c;
  --amber: #b25b00;
  --ink: #0b0c0c;
  --muted: #6b6b6b;
  --label: #8a8a8a;
  --line: #c8c8c8;
  --card: #f2f2f2;
  --bg: #ffffff;
  --focus: #ffdd00;
  --radius: 4px;
  --wrap: 760px;
  --gutter: 20px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Lato', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.45; }
a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; box-shadow: 0 0 0 5px var(--ink); }
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--focus); color: var(--ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.hdr { background: var(--brand); color: #fff; }
.hdr-in { max-width: var(--wrap); margin: 0 auto; padding: 22px var(--gutter) 14px; min-height: 116px; display: flex; flex-direction: column; justify-content: center; }
.hdr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crest { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.crest svg.star { width: 38px; height: 38px; }
.crest img { max-height: 44px; max-width: 180px; }
.crest .w1 { display: block; font-weight: 900; font-size: 9.5px; letter-spacing: .02em; line-height: 1; }
.crest .w2 { display: block; font-family: 'Montserrat', 'Lato', sans-serif; font-weight: 800; font-size: 19px; line-height: 1; letter-spacing: .01em; }
.hdr-actions { display: flex; align-items: center; gap: 14px; }
.bell { position: relative; color: #fff; display: inline-flex; padding: 6px; border-radius: 50%; }
.bell .ico { width: 22px; height: 22px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.bell .badge { position: absolute; top: -2px; right: -4px; border: 2px solid var(--brand); }
.avatar-btn { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; position: relative; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #dfe3ec; color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; border: 2px solid rgba(255,255,255,.85); flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; border-width: 1px; border-color: var(--line); }
.avatar-btn .badge { position: absolute; top: -3px; right: -3px; border: 2px solid var(--brand); }
.crumb { margin-top: 14px; font-size: 13px; }
.crumb a { color: #fff; font-weight: 700; text-underline-offset: 3px; }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 86vw); background: #fff; transform: translateX(100%); transition: transform .25s ease; z-index: 50; display: flex; flex-direction: column; box-shadow: -6px 0 24px rgba(0,0,0,.15); }
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { transform: none; }
.drawer-hd { background: var(--brand); color: #fff; min-height: 116px; padding: 18px 16px; display: flex; align-items: center; gap: 12px; }
.drawer-hd .close { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
.drawer-hd .close .ico { width: 26px; height: 26px; stroke-width: 1.6; }
.drawer-hd .who { flex: 1; text-align: right; line-height: 1.2; }
.drawer-hd .who b { display: block; text-transform: uppercase; font-size: 14px; letter-spacing: .02em; }
.drawer-hd .who span { display: block; font-size: 13.5px; }
.drawer-hd .who small { display: block; font-size: 13px; opacity: .85; font-weight: 300; }
.drawer nav { flex: 1; overflow-y: auto; padding: 6px 0; }
.drawer nav a, .drawer .logout button { display: flex; align-items: center; gap: 18px; padding: 11px 18px; color: #767676; text-decoration: none; font-size: 15.5px; background: none; border: 0; width: 100%; cursor: pointer; font-family: inherit; text-align: left; }
.drawer nav a .ico, .drawer .logout .ico { color: var(--ink); width: 21px; height: 21px; }
.drawer nav a:hover, .drawer nav a.on { color: var(--ink); background: #f5f6f9; }
.drawer nav a.on { box-shadow: inset 4px 0 0 var(--brand); }
.drawer nav .sep { margin: 8px 18px; border-top: 1px solid #e3e3e3; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--label); padding-top: 10px; }
.drawer nav a .badge { margin-left: auto; }
.drawer .logout { border-top: 1px solid #eee; padding: 6px 0 14px; }
.drawer .logout button { color: var(--ink); }

/* ---------- Layout ---------- */
main { max-width: var(--wrap); margin: 0 auto; padding-bottom: 60px; }
main.wide { max-width: 1100px; }
.page-title { padding: 30px var(--gutter) 22px; }
.page-title h1 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -.01em; line-height: 1.15; }
.page-title p { margin: 8px 0 0; color: var(--muted); }
.page-title .lead { color: var(--accent); font-weight: 700; font-size: 18px; margin-top: 10px; }
.page-title .actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.pad { padding: 0 var(--gutter); }
.section-h { padding: 22px var(--gutter) 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 0; display: flex; justify-content: space-between; align-items: center; }
.section-h a { text-transform: none; letter-spacing: 0; font-size: 14px; }

/* CTA band (dashboard) */
.cta { display: flex; align-items: center; justify-content: space-between; background: var(--accent); color: #fff; padding: 22px var(--gutter); text-decoration: none; font-size: 17px; letter-spacing: .01em; text-transform: uppercase; }
.cta:hover { background: var(--accent-dark); }
.cta.urgent { background: var(--red); }
.cta.urgent:hover { background: var(--red-dark); }
.cta + .cta { border-top: 1px solid rgba(255,255,255,.25); }

/* Stats grid */
.stats { display: grid; grid-template-columns: 1fr 1fr; padding: 30px var(--gutter) 10px; column-gap: 0; position: relative; }
.stats::before { content: ''; position: absolute; left: 50%; top: 34px; bottom: 18px; border-left: 1.5px solid #b5b5b5; }
.stat { display: block; color: inherit; text-decoration: none; padding: 4px 0 16px; margin: 0 28px 20px 0; border-bottom: 1.5px solid #b5b5b5; }
.stats .stat:nth-child(even) { margin: 0 0 20px 28px; }
.stat .n { font-size: 40px; font-weight: 700; line-height: 1.05; display: flex; align-items: baseline; gap: 6px; }
.stat .n small { font-size: 15px; color: var(--muted); font-weight: 400; }
.stat .l { text-transform: uppercase; color: #9a9a9a; font-size: 13.5px; line-height: 1.3; letter-spacing: .01em; }
.stat:hover .n { color: var(--brand); }
.meter { height: 6px; background: #e3e3e3; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter.good i { background: var(--green); }
.meter.warn i { background: var(--amber); }
.meter.bad i { background: var(--red); }

/* Cards (duty list) */
.cards { display: flex; flex-direction: column; gap: 28px; }
.cards.tight { gap: 12px; }
.card { display: block; background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px var(--gutter) 16px; color: inherit; text-decoration: none; position: relative; }
a.card:hover { background: #ebebeb; }
.card h2, .card h3 { margin: 0; font-size: 20px; font-weight: 900; line-height: 1.2; }
.card .sub { margin-top: 4px; font-size: 16px; }
.card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; font-size: 14.5px; gap: 12px; flex-wrap: wrap; }
.card .meta span { display: inline-flex; align-items: center; gap: 8px; }
.card .tagrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.card .corner { position: absolute; top: 16px; right: var(--gutter); display: flex; gap: 6px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px 24px; }
.kv dt { color: #a3a3a3; font-size: 16px; }
.kv dd { margin: 2px 0 0; font-size: 17px; }
.card .prose { font-size: 16.5px; line-height: 1.5; white-space: pre-wrap; }
.card .prose.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.card h2 + .prose, .card h3 + .prose { margin-top: 10px; }
.readmore { font-weight: 700; color: var(--brand); background: none; border: 0; padding: 0; margin-top: 10px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }

/* Tags / pills */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 3px; background: #dfe3ec; color: #1d2b57; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.tag.green { background: #cce2d8; color: #005a30; }
.tag.amber { background: #fff1c4; color: #6e3c00; }
.tag.red { background: #f6d7d2; color: #942514; }
.tag.grey { background: #e6e6e6; color: #444; }
.tag.blue { background: #d2e2f1; color: #144e81; }
.tag.dark { background: var(--ink); color: #fff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; font: inherit; font-size: 16px; font-weight: 700; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; line-height: 1.1; }
.btn:hover { background: var(--brand-dark); }
.btn.rsvp, .btn.red { background: #e00000; border-color: #c60000; font-weight: 400; font-size: 20px; min-width: 150px; min-height: 52px; }
.btn.rsvp:hover, .btn.red:hover { background: #b80000; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: var(--accent-dark); }
.btn.green { background: var(--green); }
.btn.green:hover { background: #005a30; }
.btn.ghost { background: #fff; color: var(--ink); border-color: #b1b4b6; }
.btn.ghost:hover { background: #f3f3f3; }
.btn.link { background: none; color: var(--brand); padding: 0; min-height: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Forms */
.form { padding: 0 var(--gutter); }
.field { margin-bottom: 18px; }
.field label, .field .lbl { display: block; font-weight: 700; margin-bottom: 5px; }
.field .hint { color: var(--muted); font-size: 14px; margin: -2px 0 6px; }
.input, select.input, textarea.input { width: 100%; font: inherit; font-size: 16px; padding: 10px 11px; border: 2px solid var(--ink); border-radius: 0; background: #fff; color: var(--ink); min-height: 44px; }
textarea.input { min-height: 110px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; font-weight: 400 !important; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 700; margin-bottom: 8px; }
.inline-form { display: inline; }

/* Alerts */
.flashes { padding: 16px var(--gutter) 0; display: flex; flex-direction: column; gap: 10px; }
.alert { padding: 13px 15px; border-left: 5px solid var(--brand); background: #eef2fa; font-size: 15px; }
.alert.success { border-color: var(--green); background: #e7f3ed; }
.alert.error { border-color: var(--red); background: #fbeceb; }
.alert.warn { border-color: #f0a800; background: #fff7e0; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert b { display: block; margin-bottom: 2px; }

/* Lists / tables */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #e3e3e3; }
.list > li { border-bottom: 1px solid #e3e3e3; }
.list .row { display: flex; gap: 12px; align-items: center; padding: 13px var(--gutter); color: inherit; text-decoration: none; }
a.row:hover { background: #f6f7f9; }
.list .row .grow { flex: 1; min-width: 0; }
.list .row .t { font-weight: 700; }
.list .row .s { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.list .row.unread .t::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 2px; }
.list .row .end { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; padding: 0 var(--gutter); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--ink); padding: 8px 8px 8px 0; white-space: nowrap; }
.tbl td { border-bottom: 1px solid #e3e3e3; padding: 10px 8px 10px 0; vertical-align: top; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
.empty { padding: 30px var(--gutter); color: var(--muted); text-align: center; }
.empty .ico { width: 36px; height: 36px; display: block; margin: 0 auto 8px; color: #b8b8b8; }

/* Tabs / filters */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); padding: 0 var(--gutter); overflow-x: auto; }
.tabs a { padding: 12px 14px; text-decoration: none; color: var(--muted); font-weight: 700; border-bottom: 4px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--brand); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 var(--gutter) 18px; align-items: flex-end; }
.filters .field { margin: 0; flex: 1 1 140px; }
.filters .field label { font-size: 13px; }
.filters .input { min-height: 40px; padding: 7px 9px; font-size: 15px; }

/* Availability calendar */
.cal { padding: 0 var(--gutter); }
.cal-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-hd h2 { margin: 0; font-size: 20px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .dow { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal-day { aspect-ratio: 1 / 1; min-height: 44px; border: 1px solid #ddd; background: #fff; border-radius: 3px; font: inherit; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; position: relative; padding: 2px; color: var(--ink); }
.cal-day.out { visibility: hidden; }
.cal-day.past { opacity: .45; cursor: default; }
.cal-day.today { border: 2px solid var(--ink); font-weight: 900; }
.cal-day.available { background: #cce2d8; border-color: #8cc0a6; }
.cal-day.partial { background: #fff1c4; border-color: #e5c766; }
.cal-day.unavailable { background: #f6d7d2; border-color: #e0a59c; }
.cal-day .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); position: absolute; bottom: 5px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 12px 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; border: 1px solid #bbb; }

/* Messages */
.msg { padding: 14px var(--gutter); border-bottom: 1px solid #e3e3e3; }
.msg .from { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.msg .from .when { color: var(--muted); font-size: 13px; margin-left: auto; }
.msg .body { white-space: pre-wrap; }
.msg.mine { background: #f5f7fb; }

/* Profile */
.profile-hd { display: flex; gap: 16px; align-items: center; padding: 0 var(--gutter) 20px; }
.profile-hd h2 { margin: 0; font-size: 21px; }
.profile-hd p { margin: 2px 0 0; color: var(--muted); }
.sso-note { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); padding: 0 var(--gutter) 12px; }

/* Splash / login */
.splash { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: #fff; }
.wordmark { text-align: right; display: inline-block; animation: rise .7s ease both; }
.wordmark .nx { font-family: 'Montserrat', 'Arial Black', sans-serif; font-weight: 800; font-size: clamp(54px, 15vw, 96px); letter-spacing: .02em; line-height: .9; display: block; color: #000; }
.wordmark .ds { font-family: 'Lato', sans-serif; font-weight: 400; font-size: clamp(18px, 4.6vw, 28px); display: block; margin-top: 4px; color: #000; }
.splash .panel { width: 100%; max-width: 380px; margin-top: 48px; animation: rise .7s .25s ease both; }
.splash .panel p { color: var(--muted); font-size: 14px; text-align: center; }
.dev-users { margin-top: 26px; border-top: 1px solid #e3e3e3; padding-top: 16px; }
.dev-users h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--amber); margin: 0 0 8px; }
.dev-users button { display: flex; width: 100%; justify-content: space-between; text-align: left; gap: 8px; background: #f6f6f6; border: 1px solid #e0e0e0; padding: 9px 12px; margin-bottom: 6px; font: inherit; font-size: 14px; cursor: pointer; border-radius: 3px; }
.dev-users button:hover { background: #ececec; }
.dev-users small { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Hub tiles (manage/admin) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 0 var(--gutter); }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--card); border: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 108px; }
.tile:hover { background: #ebebeb; }
.tile .ico { width: 24px; height: 24px; color: var(--brand); }
.tile b { font-size: 16px; display: flex; gap: 6px; align-items: center; }
.tile span { color: var(--muted); font-size: 13.5px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 13.5px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.right { text-align: right; }
.mt0 { margin-top: 0; } .mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
hr.rule { border: 0; border-top: 1px solid #e3e3e3; margin: 22px var(--gutter); }
details.box { margin: 0 var(--gutter) 16px; border: 1px solid var(--line); background: #fafafa; }
details.box summary { padding: 12px 14px; cursor: pointer; font-weight: 700; }
details.box > div { padding: 0 14px 14px; }
.foot { text-align: center; font-size: 12px; color: #9a9a9a; padding: 30px var(--gutter) 20px; }
.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

@media (min-width: 900px) {
  :root { --gutter: 28px; }
  .page-title h1 { font-size: 36px; }
  .cards.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 0 var(--gutter); }
  .cards.grid .card { border: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stat .n { font-size: 34px; }
  .stats::before { left: 50%; }
  .stat { margin-right: 16px; } .stats .stat:nth-child(even) { margin-left: 16px; }
  .hide-sm { display: none; }
}
@media print {
  .hdr, .drawer, .scrim, .btn, .filters, .tabs { display: none !important; }
}
[hidden] { display: none !important; }
