/* SEP Journey – mobile-first base styles. Colours as tokens; dark mode follows the device. */
:root {
  --bg: #f7f7f5; --surface: #ffffff; --text: #1d1d1b; --muted: #66665f; --line: #e2e1dc;
  --accent: #2f5d8a; --accent-text: #ffffff;
  --donate: #138808; --donate-hover: #0e6b06; --saffron: #ff9933; --saffron-light: #ffd8a8;
  --error: #b42318;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --surface: #20201e; --text: #ecebe6; --muted: #a4a39b; --line: #34332f;
          --accent: #7fb0e0; --accent-text: #0f1a24; --saffron-light: #5a3d1c; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .25rem; }
h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
.container { max-width: 760px; margin: 0 auto; padding: 16px; }
.topbar { display: flex; gap: 12px; align-items: center; padding: 10px 16px;
          background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); margin-inline-end: auto; }
.lang select { font: inherit; padding: 6px; border: 1px solid var(--line); border-radius: 8px;
               background: var(--surface); color: var(--text); max-width: 9rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
        padding: 16px; margin-bottom: 16px; }
.card.narrow { max-width: 420px; margin: 24px auto; }
.muted { color: var(--muted); font-size: .9rem; margin: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.list li:last-child { border-bottom: 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { display: inline-block; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 10px;
       background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600;
       text-decoration: none; cursor: pointer; }
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 8px; }
label { display: block; margin: 12px 0 4px; font-weight: 600; }
input, select, textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line);
       border-radius: 8px; background: var(--surface); color: var(--text); }
form .btn { margin-top: 16px; width: 100%; }
.error { color: var(--error); }
.msg { background: var(--surface); border-inline-start: 4px solid var(--accent); padding: 8px 12px; border-radius: 6px; }
.donate { max-width: 760px; width: calc(100% - 32px); margin: 8px auto 32px; padding: 16px; background: var(--surface);
          border: 1px solid var(--saffron-light); border-inline-start: 4px solid var(--saffron);
          border-radius: 12px; font-size: .9rem; }
.donate p { margin: 0 0 8px; }
.donate-amount { color: var(--donate); font-weight: 600; }
.btn-donate { background: var(--donate); color: #fff; }
.btn-donate:hover { background: var(--donate-hover); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (min-width: 640px) { .container { padding: 24px; } .list li { flex-direction: row; justify-content: space-between; gap: 12px; } }
.field { margin-bottom: 4px; }
.field.check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.field.check input { width: auto; margin-top: 4px; flex: none; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
input[type="file"] { padding: 8px; }
.org-logo { max-height: 56px; max-width: 160px; margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 6px 12px; background: var(--surface);
        border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs a { white-space: nowrap; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .95rem; }
.tabs a:hover { background: var(--bg); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--error);
         color: #fff; font-size: .75rem; text-align: center; line-height: 20px; }
.progress { margin: 8px 0 12px; }
.req { margin: 10px 0; }
.req-head { display: flex; justify-content: space-between; gap: 8px; font-size: .95rem; }
.bar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 4px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.req.met .bar > span { background: var(--donate); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .78rem; font-weight: 600;
        background: var(--bg); border: 1px solid var(--line); }
.pill.confirmed, .pill.documented, .pill.paper, .pill.at_training { color: var(--donate); border-color: var(--donate); }
.pill.awaiting { color: var(--accent); border-color: var(--accent); }
.pill.disputed { color: var(--error); border-color: var(--error); }
.entry { padding: 12px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.entry-actions form { display: inline; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-danger { background: transparent; color: var(--error); border: 1px solid var(--error); }
.warn { color: #9a6700; font-size: .85rem; margin: 4px 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.person-card { text-align: center; text-decoration: none; color: var(--text); background: var(--surface);
               border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; }
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--line); display: block; margin: 0 auto 8px; }
.avatar.lg { width: 160px; height: 160px; }
.person-card strong { display: block; font-size: .95rem; }
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input { flex: 1; }
.searchbar .btn { margin: 0; width: auto; }
.seg { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--text); font-size: .9rem; }
.seg a.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
table.matrix { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.matrix th, table.matrix td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: center; }
table.matrix th:first-child, table.matrix td:first-child { text-align: start; }
table.matrix input { width: auto; }
.hint { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: .9rem; }
.demo-banner { background: #fff4d6; color: #5c4400; text-align: center; font-size: .85rem; padding: 6px 12px; }
.demo-banner a { color: inherit; font-weight: 600; }
/* --- organizer screens ------------------------------------------------------- */
.container.wide { max-width: 1180px; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; }
.subnav a { padding: 6px 12px; border-radius: 16px; border: 1px solid var(--line); text-decoration: none;
            color: var(--text); font-size: .9rem; background: var(--surface); }
.subnav a.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
        text-decoration: none; color: var(--text); display: block; }
.stat .num { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat .lbl { color: var(--muted); font-size: .85rem; }
.stat.alert .num { color: var(--error); }
.stat.good .num { color: var(--donate); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: start; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 8px 6px;
                border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data td.num, table.data th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr:hover td { background: var(--bg); }
.who { display: flex; gap: 10px; align-items: center; }
.who img, .who .avatar { width: 36px; height: 36px; margin: 0; flex: none; }
.mini-bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; width: 70px; margin: 3px 0 0 auto; }
.mini-bar span { display: block; height: 100%; background: var(--accent); }
.flag { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 10px; margin: 1px 2px 1px 0;
        border: 1px solid var(--line); white-space: nowrap; }
.flag.behind, .flag.overdue, .flag.disputed { color: var(--error); border-color: var(--error); }
.flag.complete { color: var(--donate); border-color: var(--donate); }
.flag.no_plan { color: #9a6700; border-color: #d4a72c; }
.two-col { display: grid; gap: 16px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }
.att-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0;
           border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.att-opts { display: flex; gap: 4px; }
.att-opts label { margin: 0; font-weight: 500; }
.att-opts input { position: absolute; opacity: 0; width: 1px; }
.att-opts span { display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
                 cursor: pointer; font-size: .9rem; min-width: 44px; text-align: center; }
.att-opts input:checked + span.p { background: var(--donate); color: #fff; border-color: var(--donate); }
.att-opts input:checked + span.h { background: #d4a72c; color: #fff; border-color: #d4a72c; }
.att-opts input:checked + span.a { background: var(--error); color: #fff; border-color: var(--error); }
.att-opts input:checked + span.v { background: #5b6fb3; color: #fff; border-color: #5b6fb3; }
.att-opts input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hours-in { width: 70px; padding: 6px; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; }
.days { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; }
.days a { white-space: nowrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
          text-decoration: none; color: var(--text); font-size: .85rem; background: var(--surface); }
.days a.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline-form > * { flex: 1 1 160px; }
.inline-form .btn { flex: 0 0 auto; margin: 0; width: auto; }
pre.preview { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 8px; font: inherit; font-size: .9rem; }
/* radio / tick-all-that-apply lists in registration forms */
.field div[id^="id_x_"] > div, .field ul.choices { margin: 4px 0; }
.field div[id^="id_x_"] label { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 6px 0; }
.field div[id^="id_x_"] input { width: auto; flex: none; }
.demo-switch { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 0; }
.demo-switch span { white-space: normal; }
.demo-switch select { width: auto; max-width: 290px; padding: 3px 8px; font-size: .85rem; background: #fffaf0; color: #5c4400; border-color: #e3cf96; }
.demo-switch option { background: #fffaf0; color: #3d2d00; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 20px; }
.checklist li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; }
.checklist li span { width: 18px; color: var(--muted, #777); font-weight: 700; }
.checklist li.ok span { color: #1a7f37; }
.checklist li.ok { color: #555; }
.demo-switch label { display: inline; margin: 0; font-weight: 600; font-size: inherit; }
/* fees page */
.cutoff { display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: center; padding: 12px 16px; }
.cutoff > div { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cutoff label { margin: 0; }
.cutoff input[type=date] { width: auto; padding: 6px 8px; }
.cutoff p { margin: 0; }
.cutoff a.on { font-weight: 700; text-decoration: none; }
.stat.on { outline: 2px solid var(--accent, #2e5c8a); }
.card.highlight { outline: 2px solid #e3b341; }
.small { font-size: .85rem; }
.cutoff .btn { width: auto; }
/* type-to-search select */
.ac { position: relative; }
.ac-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; max-height: 260px; overflow-y: auto;
  box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.ac-list li { padding: 8px 12px; cursor: pointer; }
.ac-list li.on, .ac-list li:hover { background: var(--accent); color: var(--accent-text); }
.ac-list li.none { color: var(--muted); cursor: default; background: none; }
.fees-table td.contact { font-size: .85rem; }
.fees-table .btn-small { white-space: nowrap; }
.fees-table td:first-child { min-width: 170px; }
/* tick-box list of people with a filter box */
.fl-input { margin-bottom: 6px; }
.pick-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin-bottom: 10px; }
.pick-list label { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 6px 0; }
.pick-list label[hidden] { display: none; }
.pick-list input { width: auto; flex: none; }
[data-name][hidden] { display: none !important; }
.quicklinks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.quicklinks a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-decoration: none; color: var(--text); font-size: .9rem; }
.quicklinks a.alert strong { color: var(--error, #b42318); }
h2 a.small { font-size: .85rem; font-weight: 400; margin-left: 8px; }
.recipients { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 20px; max-height: 320px; overflow-y: auto; }
.recipients .who { display: block; padding: 4px 0; border-bottom: 1px solid var(--line); }
.cohort-card h2 a { text-decoration: none; color: inherit; }
.cohort-card h2 a:hover { text-decoration: underline; }
.cohort-links { display: flex; flex-wrap: wrap; gap: 6px; }
.cohort-links a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); font-size: .9rem; }
.cohort-links a.alert { color: var(--error, #b42318); border-color: currentColor; }
.cohort-links a:hover { background: var(--bg); }
.stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 640px) { .stats.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.demo-hint { background: #fff4d6; border: 1px solid #e3cf96; border-radius: 8px; padding: 10px 12px; color: #5c4400; }

/* demo bar and hint in dark mode: dark amber with light text, so the "View as" menu stays readable */
@media (prefers-color-scheme: dark) {
  .demo-banner { background: #3b2f12; color: #ffe2a0; }
  .demo-switch select { background: #2a2210; color: #ffe2a0; border-color: #7a6326; }
  .demo-switch option { background: #2a2210; color: #ffe2a0; }
  .demo-hint { background: #3b2f12; border-color: #7a6326; color: #ffe2a0; }
}

.site-footer { max-width: 760px; width: calc(100% - 32px); margin: 0 auto 24px; color: var(--muted); font-size: .8rem; text-align: center; }
.site-footer p { margin: 0; }
