:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d2330; --muted: #5d6676; --line: #dfe3ea;
  --accent: #1f5f9e; --accent-soft: #e8f0f9; --warn: #8a5a00; --warn-soft: #fff4dc;
  --topbar: #1f5f9e; --on-accent: #fff; --field: #fff; --danger: #b3261e;
  --logo-blue: #5b98cc; --logo-red: #ea0a2a; --logo-red-on-bar: #ff5a6e;   /* DataKeeper mark: the conference logo's river blue and flame red */
  --good: #1d6b3a; --good-soft: #e3f3e8; --bad: #a3261e; --bad-soft: #fbe9e7; --violet: #5b3fa3; --violet-soft: #efeafb;
  --success-bg: #e6f4e6; --success-text: #1d5e1d; --error: #a12;
  --shadow: rgba(0,0,0,.08); --shadow-strong: rgba(0,0,0,.15); --soft-line: #efeee9;
  --chart-grid: #e1e0d9; --chart-axis: #c3c2b7; --chart-text: #52514e; --chart-strong: #0b0b0b; --chart-cross: #898781;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --tip-bg: #fff;
  --viewas-bg: #ffd54a; --viewas-text: #3a2a00; --cab-bg: #3b1f4f; --cab-text: #f3e9ff;
  --radius: 8px;
  color-scheme: light;
}
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #12161d; --panel: #1a2029; --text: #e4e8ef; --muted: #9aa4b4; --line: #2c3542;
  --accent: #6aa6e8; --accent-soft: #1c2c40; --warn: #f0c068; --warn-soft: #3a2e14;
  --topbar: #173a5e; --on-accent: #0d1520; --field: #11161d; --danger: #e5534b;
  --good: #7fd39b; --good-soft: #15301f; --bad: #f19a90; --bad-soft: #3b1a17; --violet: #c2adf5; --violet-soft: #2a2140;
  --success-bg: #15301f; --success-text: #a6e3b8; --error: #f19a90;
  --shadow: rgba(0,0,0,.4); --shadow-strong: rgba(0,0,0,.5); --soft-line: #2c3542;
  --chart-grid: #2c3542; --chart-axis: #48536a; --chart-text: #9aa4b4; --chart-strong: #e4e8ef; --chart-cross: #6b7689;
  --s1: #5b9cf0; --s2: #f08a5d; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --tip-bg: #1a2029;
  --viewas-bg: #6b5300; --viewas-text: #fff2c4; --cab-bg: #2a1838; --cab-text: #e9dcfb;
  color-scheme: dark;
} }
@media screen { :root[data-theme="dark"] {
  --bg: #12161d; --panel: #1a2029; --text: #e4e8ef; --muted: #9aa4b4; --line: #2c3542;
  --accent: #6aa6e8; --accent-soft: #1c2c40; --warn: #f0c068; --warn-soft: #3a2e14;
  --topbar: #173a5e; --on-accent: #0d1520; --field: #11161d; --danger: #e5534b;
  --good: #7fd39b; --good-soft: #15301f; --bad: #f19a90; --bad-soft: #3b1a17; --violet: #c2adf5; --violet-soft: #2a2140;
  --success-bg: #15301f; --success-text: #a6e3b8; --error: #f19a90;
  --shadow: rgba(0,0,0,.4); --shadow-strong: rgba(0,0,0,.5); --soft-line: #2c3542;
  --chart-grid: #2c3542; --chart-axis: #48536a; --chart-text: #9aa4b4; --chart-strong: #e4e8ef; --chart-cross: #6b7689;
  --s1: #5b9cf0; --s2: #f08a5d; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --tip-bg: #1a2029;
  --viewas-bg: #6b5300; --viewas-text: #fff2c4; --cab-bg: #2a1838; --cab-text: #e9dcfb;
  color-scheme: dark;
} }
* { box-sizing: border-box; }
[hidden] { display: none !important; }      /* hidden always wins over a class's display (buttons, form rows) */
body { margin: 0; font: 15px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.topbar { background: var(--topbar); color: #fff; }
.topbar .inner { max-width: 1200px; margin: 0 auto; padding: .6rem 1rem; display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.topbar a { color: #fff; }
.topbar .brand { font-weight: 700; font-size: 1.05rem; display: inline-flex; align-items: center; gap: .4rem;
  --logo-red: var(--logo-red-on-bar); }
.login-brand { display: flex; align-items: center; gap: .55rem; color: var(--logo-blue); margin-bottom: .2rem; }
.login-brand span { color: var(--text); }
.login-sub { margin-top: 0; }
.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar nav a { white-space: nowrap; }
.topbar form.search { display: flex; }
.topbar input[type=search] { border: 0; border-radius: var(--radius); padding: .4rem .7rem; width: 16rem; max-width: 50vw;
  background: var(--field); color: var(--text); }
.topbar .user { font-size: .9rem; opacity: .9; display: flex; gap: .75rem; align-items: center; }
.topbar .user button { background: none; border: 0; color: #fff; cursor: pointer; font: inherit; padding: 0; }

main { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.subtitle { color: var(--muted); margin: 0 0 1.25rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.badge { display: inline-block; font-size: .75rem; padding: .05rem .5rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--good-soft); color: var(--good); }
/* Google Workspace page (records/workspace.py) */
.ws-buttons { display: flex; flex-wrap: wrap; gap: .35rem; }
.stacked-form.ws-form input:not([type=checkbox]), .ws-form select { width: 100%; max-width: 30rem; box-sizing: border-box; }
.ws-buttons form { margin: 0; }
.ws-password { font: 600 1.25rem/1.4 ui-monospace, Consolas, monospace; letter-spacing: .04em; padding: .5rem .8rem;
  background: var(--accent-soft); border-radius: var(--radius); display: inline-block; user-select: all; }
.muted { color: var(--muted); }
.notice { background: var(--warn-soft); color: var(--warn); padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; }

dl.fields { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
dl.fields dt { color: var(--muted); }
dl.fields dd { margin: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
tr.ended td { color: var(--muted); }
.table-wrap { overflow-x: auto; }

form.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.check-inline { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .9rem; white-space: nowrap; }
input, select, button { font: inherit; }
form.filters input, form.filters select { padding: .35rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); color: var(--text); }
.btn { display: inline-block; background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--radius); padding: .4rem .9rem; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn.secondary { background: var(--panel); color: var(--accent); border: 1px solid var(--line); }

.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: .15rem .55rem; font-size: .85rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
/* Person page header: photo beside the name */
.person-head { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.25rem; }
.person-head-text { flex: 1; min-width: 0; }
.person-head-text .subtitle { margin-bottom: .5rem; }
.person-photo { width: 120px; height: 150px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); flex: none; }
.person-photo.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem;
  text-decoration: none; border-style: dashed; }
.person-photo.empty:hover { color: var(--accent); border-color: var(--accent); }
.edit-form .person-photo { width: 180px; height: auto; }
@media (max-width: 600px) { .person-head { flex-direction: column; } .person-photo { width: 96px; height: 120px; } }
.row-actions { white-space: nowrap; text-align: right; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem 1.25rem; }
.form-row { display: flex; flex-direction: column; gap: .2rem; }
.form-row.wide, .form-row:has(textarea) { grid-column: 1 / -1; }
.form-row label { font-size: .85rem; color: var(--muted); }
.form-row.check label { color: var(--text); font-size: .95rem; display: flex; gap: .5rem; align-items: center; }
.form-row input:not([type=checkbox]), .form-row select, .form-row textarea {
  padding: .4rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); color: var(--text); width: 100%; }
.form-row.has-error input, .form-row.has-error select { border-color: var(--danger); }
.form-actions { display: flex; gap: .5rem; margin-top: 1.25rem; align-items: center; }

.lookup { position: relative; }
.lookup-results { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px var(--shadow); max-height: 18rem; overflow-y: auto; }
.lookup-results li { padding: .4rem .6rem; cursor: pointer; }
.lookup-results li small { color: var(--muted); }
.lookup-results li:hover, .lookup-results li.active { background: var(--accent-soft); }

.report-item { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.report-item:last-child { border-bottom: 0; }
.report-filters { display: flex; flex-wrap: wrap; gap: .9rem 1.25rem; align-items: flex-start; }
.report-filters .form-row { min-width: 180px; }
.report-filters .form-actions { flex-basis: 100%; margin-top: .25rem; }
.report-filters select[multiple] { min-width: 260px; }
.report-filters[data-report="officers"] .field-category { flex-basis: 100%; }   /* Offices on its own line, under District */
.report-filters[data-report="officers"] .field-category select { width: 100%; max-width: 420px; }
.report-section { margin-bottom: 1.5rem; }
.report-section h2 { margin: 1rem 0 .1rem; }
.report-section > p.muted { margin: 0 0 .4rem; }
.report-table { background: var(--panel); font-size: .9rem; }
.report-table td.num, .report-table th.num { text-align: right; white-space: nowrap; }
.report-table tfoot td { font-weight: 600; border-top: 2px solid var(--text); }
.report-table .group-start { border-left: 2px solid var(--line); }
.report-table .head-groups th { text-align: center; border-bottom: 1px solid var(--line); }
.print-only { display: none; }

/* Year charts (year_chart.js) */
.year-chart { position: relative; margin: .25rem 0 1rem; }
.chart-svg { display: block; font: 12px system-ui, "Segoe UI", sans-serif; outline: none; }
.chart-svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.chart-svg .grid { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-svg .axis { stroke: var(--chart-axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart-svg .tick { fill: var(--chart-text); font-variant-numeric: tabular-nums; }
.chart-svg .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .series-dot { stroke: var(--panel); stroke-width: 2; }
.chart-svg .series-line.s1 { stroke: var(--s1); }   /* series slot 1: salary */
.chart-svg .series-dot.s1 { fill: var(--s1); }
.chart-svg .series-line.s2 { stroke: var(--s2); }   /* series slot 2: total compensation */
.chart-svg .series-dot.s2 { fill: var(--s2); }
.chart-svg .end-label { fill: var(--chart-strong); font-weight: 600; }
.chart-svg .crosshair { stroke: var(--chart-cross); stroke-width: 1; }
.chart-legend { display: flex; gap: 1.25rem; font-size: .85rem; color: var(--chart-text); margin-bottom: .35rem; }
.chart-legend span, .tip-row { display: inline-flex; align-items: center; gap: .4rem; }
.key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; }
.key.s1 { background: var(--s1); }
.key.s2 { background: var(--s2); }
.chart-tip { position: absolute; pointer-events: none; background: var(--tip-bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 4px 14px var(--shadow); padding: .35rem .6rem; white-space: nowrap; font-size: .85rem; }
/* Shares of Ministry report dashboard (records/reports/_shares_dashboard.html, shares_chart.js) */
.som-dash { margin-bottom: 1rem; }
.som-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.som-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; }
.som-kpi-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.som-kpi-value { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.som-kpi-sub { font-size: .8rem; color: var(--muted); }
.som-title { font-size: 1rem; margin: 0 0 .5rem; }
.som-year-chart { position: relative; }
.som-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 0 1rem; }
.som-bar { display: grid; grid-template-columns: minmax(7rem, 35%) 1fr 3.8rem; gap: .5rem; align-items: center; margin: .3rem 0; font-size: .9rem; }
.som-bar-track { height: 14px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.som-bar-track span { display: block; height: 100%; max-width: 100%; background: var(--accent); border-radius: 0 4px 4px 0; opacity: .55; }
.som-bar.picked .som-bar-track span { opacity: 1; }
.som-bar.picked .som-bar-name { font-weight: 600; }
.som-bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.chart-svg .zoom-band { fill: var(--accent); opacity: .12; }
.som-year-chart .chart-svg { cursor: crosshair; user-select: none; }
.som-month summary { cursor: pointer; font-weight: 600; margin: 0; }
.som-month[open] summary { margin-bottom: .5rem; }
.journal-ask textarea { width: 100%; box-sizing: border-box; font: inherit; margin: .3rem 0 .6rem; }
.journal-ask label { font-weight: 600; }
.journal-ask-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.journal-answer .journal-q { font-weight: 600; margin-top: 0; }
.journal-answer #journal-text { line-height: 1.55; }
.journal-cite { white-space: nowrap; font-size: .85em; padding: 0 .3em; border-radius: 4px; background: var(--accent-soft); text-decoration: none; }
.journal-past { border-top: 1px solid var(--line); padding: .5rem 0; }
.journal-past summary { cursor: pointer; }
.journal-past > div { margin: .5rem 0 0 1rem; line-height: 1.55; }
.spinner { display: inline-block; width: 1.5em; height: 1.5em; vertical-align: -.45em; margin-right: .55em; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.btn:disabled { opacity: .6; cursor: progress; }
/* Claude usage page (journal.usage, superusers) */
.usage-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.usage-filters select { max-width: 100%; }
.usage-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: .8rem; margin-bottom: 1rem; }
.usage-tile { display: flex; flex-direction: column; gap: .15rem; margin: 0; }
.usage-tile strong { font-size: 1.35rem; }
.usage-bad { color: var(--bad); font-weight: 600; }
.usage-ok { color: var(--good); }
.usage-q { border-top: 1px solid var(--line); padding: .45rem 0; }
.usage-q summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .25rem .8rem; }
.usage-when { min-width: 8.5em; color: var(--muted); }
.usage-text { flex-basis: 100%; min-width: 0; overflow-wrap: anywhere; }
.usage-detail { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem 1rem; margin: .6rem 0 .3rem 1rem; }
.usage-detail dt { font-weight: 600; }
.usage-detail dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.usage-error { white-space: pre-wrap; font-size: .85em; }
@media screen and (max-width: 600px) { .usage-detail { grid-template-columns: minmax(0, 1fr); margin-left: 0; } }
/* Continuing education (records/ceus.py, records/_ceus.html) */
.ceu-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: .8rem; margin-bottom: 1rem; }
.ceu-tile { display: flex; flex-direction: column; gap: .2rem; margin: 0; }
.ceu-tile strong { font-size: 1.3rem; }
.ceu-bar { display: block; height: .55rem; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin: .2rem 0; }
.ceu-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.ceu-ok { color: var(--good); font-weight: 600; }
.ceu-bad { color: var(--bad); font-weight: 600; }
.ceu-warn { color: var(--warn); }
.ceu-periods { max-width: 34rem; }
.ceu-current td { font-weight: 600; }
.ceu-group { border-top: 1px solid var(--line); padding: .5rem 0; }
.ceu-group > summary { cursor: pointer; font-weight: 600; }
.ceu-list { margin-top: .5rem; }
.ceu-date { white-space: nowrap; }
.ceu-files { white-space: nowrap; }
.ceu-file { display: inline-flex; margin-right: .3rem; }
.ceu-file .journal-icon { margin-left: 0; }
.inline-check { display: inline-flex; gap: .3rem; align-items: center; margin-left: .6rem; font-size: .9rem; }
.journal-icon {display: inline-flex; vertical-align: middle; padding: .15rem; margin-left: .25rem; border-radius: 4px; color: var(--muted); }
.journal-icon:hover { color: var(--accent); background: var(--accent-soft); }
.journal-tools { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-bottom: .5rem; }
.journal-tools .icon { vertical-align: -3px; }
.journal-printed { line-height: 1.55; }
@media print { .journal-cite { background: none; padding: 0; } }
.journal-text { white-space: pre-wrap; font-family: inherit; font-size: .9rem; line-height: 1.5; margin: 0; }
.som-years { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.som-years a, .som-years strong { padding: .2rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.som-years strong { background: var(--accent); border-color: var(--accent); color: var(--panel); }
.som-statement .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.som-zoom { font-size: .8rem; margin-top: .25rem; }
.som-bar.som-group { margin-top: .6rem; font-weight: 600; }
.som-bar.som-sub .som-bar-name { padding-left: 1rem; }
.report-filters[data-report="shares-of-ministry"] .form-row { min-width: 0; }   /* every filter on one line */
.report-filters[data-report="shares-of-ministry"] :is(.field-year, .field-start, .field-end) select { width: 7.5rem; }
.som-month-table th.picked { color: var(--text); text-decoration: underline; }
.chart-svg .som-line { stroke-width: 1.5; opacity: .45; }
.chart-svg .som-line.picked { stroke-width: 2.5; opacity: 1; }
.som-legend span { opacity: .6; }
.som-legend span.picked { opacity: 1; font-weight: 600; }
.chart-svg .som-s1, .key.som-s1 { stroke: var(--s1); fill: var(--s1); background: var(--s1); }
.chart-svg .som-s2, .key.som-s2 { stroke: var(--s2); fill: var(--s2); background: var(--s2); }
.chart-svg .som-s3, .key.som-s3 { stroke: var(--s3); fill: var(--s3); background: var(--s3); }
.chart-svg .som-s4, .key.som-s4 { stroke: var(--s4); fill: var(--s4); background: var(--s4); }
.chart-svg .som-s5, .key.som-s5 { stroke: var(--s5); fill: var(--s5); background: var(--s5); }
.chart-svg .som-s6, .key.som-s6 { stroke: var(--s6); fill: var(--s6); background: var(--s6); }
.chart-svg .som-line.som-s1, .chart-svg .som-line.som-s2, .chart-svg .som-line.som-s3, .chart-svg .som-line.som-s4,
.chart-svg .som-line.som-s5, .chart-svg .som-line.som-s6 { fill: none; }
.chart-tip .tip-head { color: var(--chart-text); margin-bottom: .15rem; }
.chart-tip .tip-row { display: flex; }
.chart-tip strong { color: var(--chart-strong); font-variant-numeric: tabular-nums; min-width: 5.5em; }
.chart-tip span { color: var(--chart-text); }

.dq-summary { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.dq-summary a { white-space: nowrap; }

.last-change { margin: -.9rem 0 1.25rem; font-size: .85rem; }
.history ul.changes { margin: 0; padding-left: 1rem; }
.history td { vertical-align: top; }

/* Home page */
/* Home page: profile form progress (one green, darker = further along; gray = not started) */
:root { --prog-done: #1d6b3a; --prog-one: #4f9a68; --prog-started: #a3d1b2; --prog-none: #cfd4dc; }
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --prog-done: #7fd39b; --prog-one: #4f9a68; --prog-started: #2f6342; --prog-none: #3a4250; } }
@media screen { :root[data-theme="dark"] { --prog-done: #7fd39b; --prog-one: #4f9a68; --prog-started: #2f6342; --prog-none: #3a4250; } }
.progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem 2rem; }
.progress-block h3 { margin: .25rem 0; font-size: 1rem; }
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.small-check { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; color: var(--muted); cursor: pointer; }
.progress-legend a { color: inherit; }
.progress-legend a:hover { color: var(--accent); }
.progress-bar a.seg:hover { opacity: .8; }
.progress-headline { margin: .2rem 0 .5rem; }
.progress-headline strong { font-size: 1.6rem; }
.progress-bar { display: flex; gap: 2px; height: 16px; }
.progress-bar .seg { min-width: 4px; }
/* Home page box at half width: the two forms stacked, a bit tighter */
.compact-progress .progress-grid { grid-template-columns: 1fr; gap: .9rem; }
.compact-progress .progress-headline { margin: .1rem 0 .4rem; }
.compact-progress .progress-headline strong { font-size: 1.3rem; }
.compact-progress .progress-bar { height: 12px; }
.compact-progress .progress-legend { margin: .45rem 0 0; gap: .2rem .8rem; }
.compact-progress > p:last-child { margin: .8rem 0 0; }
/* Home page: charge conference forms box */
:root { --prog-returned: #c77c12; }
@media screen { :root[data-theme="dark"] { --prog-returned: #e0a243; } }
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --prog-returned: #e0a243; } }
.seg.returned, .swatch.returned { background: var(--prog-returned); }
:root { --prog-lapsed: #c0392b; }
@media screen { :root[data-theme="dark"] { --prog-lapsed: #e5675c; } }
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --prog-lapsed: #e5675c; } }
.seg.lapsed, .swatch.lapsed { background: var(--prog-lapsed); }
/* Home page: At a glance box, and "Arrange boxes" */
.glance { list-style: none; margin: 0; padding: 0; }
.glance li + li { border-top: 1px solid var(--line); }
.glance a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0;
  color: inherit; text-decoration: none; }
.glance a:hover .glance-label { color: var(--accent); }
.glance-label { color: var(--muted); }
.glance strong { font-size: 1.6rem; line-height: 1.1; }
#home-boxes { align-items: start; }
#home-boxes.masonry { grid-auto-rows: 4px; row-gap: 0; }    /* home_masonry.js: each box spans its height in 4px rows */
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem 1rem; flex-wrap: wrap; }
.home-arrange { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.home-arrange-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.home-arrange-bar:not([hidden]) { padding: .4rem .6rem; border: 1px solid var(--accent); border-radius: 6px;
  background: var(--accent-soft); }
.arranging > [data-box] { outline: 2px dashed var(--accent); outline-offset: -2px; cursor: move; }
.arranging > [data-box].dragging { opacity: .45; }
.arrange-tools { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: -.25rem 0 .6rem;
  padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.arrange-grip { color: var(--accent); font-size: .85rem; }
/* Home page boxes: the title on its own line, the box's menus under it (they shrink or stack, never overflow) */
.dash-title { margin: 0 0 .5rem; }
.dash-pick { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.dash-pick select { max-width: 100%; min-width: 0; flex: 1 1 10rem; }
.cc-waiting { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem .7rem;
  margin: .2rem 0 .5rem; border: 1px solid var(--line); border-radius: 6px; color: inherit; text-decoration: none; }
.cc-waiting strong { font-size: 1.3rem; }
.cc-waiting.has-some { border-color: var(--accent); background: var(--accent-soft); }
.cc-waiting:hover { border-color: var(--accent); }
.cc-dash-group { margin: 0; }
.cc-dash-h { font-size: .9rem; margin: .9rem 0 .35rem; color: var(--muted); }
.cc-rows { display: grid; grid-template-columns: auto 1fr auto; gap: .3rem .6rem; align-items: center; font-size: .85rem; }
.cc-rows .progress-bar { height: 10px; }
.cc-row-label { color: inherit; white-space: nowrap; }
.cc-row-label:hover { color: var(--accent); }
.cc-row-n { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.progress-bar .seg:first-child { border-radius: 4px 0 0 4px; }
.progress-bar .seg:last-child { border-radius: 0 4px 4px 0; }
.progress-bar .seg:only-child { border-radius: 4px; }
.progress-legend { list-style: none; padding: 0; margin: .6rem 0 .4rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .85rem; color: var(--muted); }
.progress-legend li { display: flex; align-items: center; gap: .35rem; }
.progress-legend strong { color: var(--text); }
.progress-legend .swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.seg.done, .swatch.done { background: var(--prog-done); }
.seg.one, .swatch.one { background: var(--prog-one); }
.seg.started, .swatch.started { background: var(--prog-started); }
.seg.none, .swatch.none { background: var(--prog-none); }
@media print { .seg, .swatch { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }
.portal-churches { list-style: none; padding: 0; margin: .5rem 0 0; }
.portal-churches li + li { border-top: 1px solid var(--line); }
.portal-churches form { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .4rem 1rem; padding: .6rem 0; }
.portal-church-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.portal-church-name .portal-church-open { font-size: 1.05rem; font-weight: 600; padding: 0; text-align: left;
  text-decoration: underline; text-underline-offset: 3px; }
.portal-church-name .portal-church-open:hover { text-decoration-thickness: 2px; }
/* Church officers on the church portal (records/officers.py) */
.officer-table td { vertical-align: top; }
.officer-choice label { display: block; white-space: nowrap; }
.officer-offices { margin: 0; padding: 0; list-style: none; }
.officer-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: .2rem 1rem; }
.officer-boxes label { display: flex; gap: .4rem; align-items: baseline; font-weight: normal; }
.officer-boxes label.held { font-weight: 600; }
.officer-pick { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.officer-pick legend { font-weight: 600; margin-bottom: .4rem; }
.officer-renew tr:not(.officer-first) td { border-top-color: transparent; }
.officer-new { border: 1px solid var(--line); border-radius: 8px; padding: .5rem 1rem; margin: 0 0 1rem; min-width: 0; }
/* Clearances report: lapsed / missing in red, lapsing soon in amber (reports.ClearancesReport) */
.report-table td.cl-lapsed, .report-table td.cl-missing { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.report-table td.cl-soon { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.clearance-counts table { width: auto; }
.clearance-counts th[scope="row"] { text-align: left; font-weight: 600; }
.clearance-counts td.num { min-width: 5.5rem; }
.clearance-counts .cl-count-missing a, .clearance-counts .cl-count-lapsed a { color: var(--bad); font-weight: 700; }
.clearance-counts .cl-count-30 a, .clearance-counts .cl-count-60 a, .clearance-counts .cl-count-90 a { color: var(--warn); font-weight: 700; }
.clearance-counts .cl-count-current a { color: var(--good); font-weight: 700; }
.clearance-counts tr.picked { background: var(--accent-soft); }
.clearance-counts td.here { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Emailing a charge conference packet (records/cc_packet.py) */
.packet-icons { display: inline-flex; align-items: center; gap: .3rem; margin-left: .5rem; white-space: nowrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  border: 1px solid var(--line); border-radius: 6px; color: var(--accent); background: var(--panel); }
.icon-btn:hover { background: var(--accent-soft); text-decoration: none; }
.packet-to { display: grid; gap: .25rem; }
.packet-to label { display: flex; gap: .4rem; align-items: baseline; overflow-wrap: anywhere; }
.stacked-form textarea, .stacked-form input[type=text] { width: 100%; max-width: 40rem; box-sizing: border-box; }
/* District messages on the portals (records/portal_messages.py) */
.district-message { background: var(--accent-soft); border-left: 4px solid var(--accent); }
.district-message h2 { font-size: 1rem; }
.district-message p:last-child { margin-bottom: 0; }
.portal-message-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); gap: 0 2rem; }
.portal-message-grid textarea { width: 100%; box-sizing: border-box; }
.officer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: 0 1rem; }
@media screen and (max-width: 600px) {
  .officer-table thead { display: none; }
  .officer-table, .officer-table tbody, .officer-table tr, .officer-table td { display: block; width: 100%; }
  .officer-table tr { border-top: 1px solid var(--line); padding: .5rem 0; }
  .officer-table td { border: 0; padding: .1rem 0; overflow-wrap: anywhere; }
}
.ceu-chart { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.ceu-pie { width: 110px; height: 110px; flex: none; }
.ceu-headline { margin: 0 0 .3rem; }
.ceu-headline strong { font-size: 1.4rem; }
.ceu-legend { margin: .3rem 0 0; }
.ceu-pie .slice { stroke: var(--panel); stroke-width: 1.2; cursor: pointer; }
.ceu-pie a:hover .slice { opacity: .8; }
.slice.done { fill: var(--prog-done); } .slice.started { fill: var(--prog-started); } .slice.none { fill: var(--prog-none); }
.ceu-legend { flex-direction: column; font-size: .9rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-tile { display: flex; flex-direction: column; gap: .2rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1.1rem; color: var(--text); }
.stat-tile:hover { text-decoration: none; border-color: var(--accent); }
.stat-label { font-size: .85rem; color: var(--muted); }
.stat-value { font-size: 2rem; font-weight: 600; line-height: 1.1; }
.home-row { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.home-row:last-child { border-bottom: 0; }
.nowrap { white-space: nowrap; }
.link-list { margin: 0; padding-left: 1.1rem; }
.link-list li { margin: .2rem 0; }

/* Printable clergy profile */
.profile-toolbar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.profile-toolbar form.filters { margin: 0; }
.profile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem; font-size: .92rem; }
.profile-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--text); padding-bottom: .5rem; margin-bottom: .75rem; }
.profile-head h1 { font-size: 1.45rem; }
.profile-sub { margin: .1rem 0 0; color: var(--muted); }
.profile-meta { text-align: right; font-size: .8rem; white-space: nowrap; }
.profile-name { flex: 1; min-width: 0; }
.profile-photo { width: 1in; height: 1.25in; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); flex: none;
  print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.profile-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
.profile section { margin-top: .9rem; }
.profile h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 .3rem;
  border-bottom: 1px solid var(--line); padding-bottom: .15rem; }
.profile p { margin: .2rem 0; }
.profile-table { width: 100%; border-collapse: collapse; }
.profile-table th { font-size: .72rem; padding: .1rem .35rem; }
.profile-table td { padding: .12rem .35rem; border-bottom: 1px solid var(--soft-line); }
.profile-table .w-label { width: 34%; }
.profile-table .w-date { width: 4.5rem; white-space: nowrap; }
ul.compact { margin: 0; padding-left: 1rem; }
.profile-foot { margin-top: 1rem; font-size: .8rem; }

.messages { margin-bottom: 1rem; display: grid; gap: .4rem; }
.message { background: var(--accent-soft); color: var(--accent); border-radius: var(--radius); padding: .55rem .9rem; }
.message.success { background: var(--success-bg); color: var(--success-text); }
.message.warning, .message.error { background: var(--warn-soft); color: var(--warn); }

tr.needs-fix td { background: var(--warn-soft); }

.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
details.section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; }
details.section > summary { padding: .75rem 1.25rem; cursor: pointer; font-weight: 600; }
details.section > div { padding: 0 1.25rem 1rem; }

.login { max-width: 360px; margin: 4rem auto; }
.login label { display: block; margin: .75rem 0 .25rem; }
.login input { width: 100%; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius); }
.errorlist { color: var(--error); padding-left: 1rem; }
.btn.google { width: 100%; padding: .6rem; font-size: 1rem; }
.password-login { margin-top: 1.25rem; }
.password-login summary { cursor: pointer; color: var(--muted); font-size: .9rem; }

@media print {
  .topbar, form.filters, .pager, .no-print { display: none !important; }
  .print-only { display: block; }
  main { max-width: none; padding: 0; }
  .report-table { font-size: 8.5pt; }
  .report-table th, .report-table td { padding: .15rem .3rem; }
  .report-section { break-inside: auto; }
  .report-section h2 { break-after: avoid; }
  tr { break-inside: avoid; }
  .profile { border: 0; padding: 0; margin: 0; font-size: 9.5pt; }
  .profile + .profile { break-before: page; }
  .profile h2 { break-after: avoid; }
  .profile section { break-inside: auto; }
  a { color: inherit; }
  body { background: #fff; }
  .panel, details.section { border: 0; padding: 0; }
  details.section > div { display: block; }
}

/* Email: compose and sent message */
.recipient-list { list-style: none; padding: 0; margin: 0; max-height: 28rem; overflow-y: auto; }
.recipient-list li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.recipient-list label { font-weight: 500; }
/* Mass email results: the recipients table */
.mass-recipients td { vertical-align: top; }
.mass-recipients .link-cell { word-break: break-all; line-height: 1.3; margin-top: .15rem; }
.sub-buttons { display: flex; gap: .3rem; flex-wrap: wrap; }
/* Mass email drafts */
.link-button { background: none; border: 0; padding: 0 .25rem; color: var(--accent); cursor: pointer; font: inherit; font-size: .85rem; }
.link-button:hover { text-decoration: underline; }
.link-button.danger { color: var(--danger); }
/* Email page: "Use a template" */
.template-pick-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.template-pick select { min-width: 16rem; }
.template-pick-row select { flex: 0 1 26rem; width: auto; }
/* Clergy portal (records/portal.py, templates/portal/): its own simple top bar and a long, readable form */
.portal-bar { background: var(--topbar); color: #fff; }
.portal-bar .inner { max-width: 860px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.portal-viewing { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn); }
.portal-viewing .inner { max-width: 860px; margin: 0 auto; padding: .5rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; }
.portal-viewing form { margin: 0; }
.portal-brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; margin-right: auto; }
.portal-brand:hover { text-decoration: none; }
.portal-brand img { background: #fff; border-radius: 50%; }
.portal-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.portal-brand small { opacity: .85; font-size: .8rem; }
.portal-who { display: flex; align-items: center; gap: .9rem; font-size: .9rem; }
.portal-who a, .portal-who .link-button { color: #fff; font-size: .9rem; }
.portal-main { max-width: 860px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.portal-signin { max-width: 520px; margin: 2rem auto; }
.portal-card h2 { margin-top: 0; }
/* District directory on the clergy portal (records/directory.py, portal/directory.html, directory.js) */
.portal-main.dd-wide { max-width: 1100px; }
.dd-intro { margin-top: -.4rem; }
.dd-listing { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; font-size: .9rem; margin: 0 0 .8rem; }
.dd-search { width: 100%; box-sizing: border-box; padding: .55rem .8rem; font-size: 1rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--field); color: var(--text); margin-bottom: .6rem; }
.dd-tabs { display: flex; flex-wrap: wrap; gap: .2rem; border-bottom: 2px solid var(--line); }
.dd-tabs a { border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
  padding: .45rem .8rem; color: var(--muted); font-size: .92rem; margin-bottom: -2px; }
.dd-tabs a:hover { color: var(--text); text-decoration: none; background: var(--panel); }
.dd-tabs a[aria-selected=true] { background: var(--panel); color: var(--accent); font-weight: 600; border-color: var(--line);
  border-bottom: 2px solid var(--panel); }
.dd-hits { font-size: .75rem; margin-left: .3rem; color: var(--muted); font-weight: normal; }
.dd-pick { display: none; }
.dd-section { border-top-left-radius: 0; border-top: 0; }
.js-dd .dd-section:not(.on) { display: none; }
.dd-section h2 { margin-top: 0; }
.dd-sub-h { font-size: 1rem; margin: 1.3rem 0 .4rem; }
.dd-sub-h2 { margin-top: 2rem !important; padding-top: 1rem; border-top: 1px solid var(--line); }
.dd-count { font-size: .8rem; font-weight: normal; color: var(--muted); background: var(--bg); border: 1px solid var(--line);
  border-radius: 99px; padding: 0 .5rem; vertical-align: middle; }
.dd-name { font-weight: 600; }
.dd-sub { color: var(--muted); font-size: .88rem; }
.dd-nowrap { white-space: nowrap; }
.dd .lbl, .dd-section .lbl { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin-top: .35rem; }
.dd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.dd-card, .dd-church { padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
  font-size: .92rem; overflow-wrap: anywhere; }
.dd-hours { border-top: 1px dashed var(--line); margin-top: .5rem; padding-top: .2rem; }
.dd-text { font-size: .95rem; }
.dd-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.dd-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  font-weight: 600; padding: .3rem .6rem .3rem 0; border-bottom: 1px solid var(--line); }
.dd-table td { padding: .45rem .6rem .45rem 0; border-bottom: 1px solid var(--soft-line); vertical-align: top; overflow-wrap: anywhere; }
.dd-table tbody tr:hover { background: var(--accent-soft); }
.dd-table .dd-name, .dd-table .dd-sub { display: block; }
.dd-grouphead th { text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--text); padding: 1.1rem 0 .35rem;
  border-bottom: 2px solid var(--line); }
.dd-group:first-of-type .dd-grouphead th { padding-top: .6rem; }
.dd-cl td:first-child { width: 60%; }
.dd-fixed { table-layout: fixed; }                    /* committees: the same columns from one table to the next */
.dd-fixed th:nth-child(1) { width: 30%; } .dd-fixed th:nth-child(2) { width: 28%; } .dd-fixed th:nth-child(3) { width: 18%; }
.dd-charges-head { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.5fr) auto; gap: .8rem;
  align-items: end; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600;
  padding: 0 0 .3rem 1.4rem; border-bottom: 1px solid var(--line); }
.dd-charge { border-bottom: 1px solid var(--soft-line); }
.dd-charge summary { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.5fr); gap: .8rem;
  padding: .5rem 0 .5rem 1.4rem; cursor: pointer; list-style: none; position: relative; font-size: .92rem; }
.dd-charge summary::-webkit-details-marker { display: none; }
.dd-charge summary::before { content: "›"; position: absolute; left: .35rem; top: .4rem; color: var(--accent); font-size: 1.1rem;
  transition: transform .15s; }
.dd-charge[open] summary::before { transform: rotate(90deg); }
.dd-charge summary:hover, .dd-charge[open] summary { background: var(--accent-soft); }
.dd-c1 .dd-name, .dd-c1 .dd-sub { display: block; }
.dd-charge-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; padding: .8rem 0 1rem 1.4rem; }
.dd-churches { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.dd-pastors { display: flex; flex-direction: column; gap: .7rem; }
.dd-person { padding: .6rem .75rem; border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0; font-size: .92rem; overflow-wrap: anywhere; }
.dd-nums { font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.dd-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.dd-month { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .7rem; font-size: .88rem; }
.dd-month.now { border-color: var(--accent); background: var(--accent-soft); }
.dd-month h4 { margin: 0 0 .25rem; }
.dd-month ul { list-style: none; margin: 0; padding: 0; }
.dd-month li { display: flex; gap: .3rem; }
.dd-month .day { flex: 0 0 1.4rem; color: var(--muted); }
.dd-none { display: none !important; }
@media screen and (max-width: 760px) {
  .dd-tabs { display: none; }
  .js-dd .dd-pick { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; font-weight: 600; }
  .dd-pick select { flex: 1; padding: .45rem; font-size: 1rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--field); color: var(--text); }
  .dd-section { border-top: 1px solid var(--line); border-radius: var(--radius); }
  .dd-charges-head { display: flex; justify-content: flex-end; padding: 0 0 .4rem; border: 0; }
  .dd-charges-head span { display: none; }
  .dd-charge summary { grid-template-columns: 1fr; gap: .1rem; }
  .dd-c2 { color: var(--muted); font-size: .85rem; }
  .dd-charge-body { grid-template-columns: 1fr; padding-left: 0; }
  .dd-table thead { display: none; }
  .dd-table, .dd-table tbody, .dd-table tr, .dd-table td, .dd-table th { display: block; width: auto !important; }
  .dd-table tr { padding: .5rem 0; border-bottom: 1px solid var(--soft-line); }
  .dd-table td { border: 0; padding: .05rem 0; }
}
.badge.good { background: var(--good-soft); color: var(--good); }
.portal-form .panel { margin-bottom: 1rem; }
.portal-form h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
.portal-text { color: var(--muted); font-size: .92rem; margin: .5rem 0 .75rem; }
.portal-text p { margin: 0 0 .5rem; }
.portal-q { display: flex; flex-direction: column; gap: .3rem; margin: 0 0 1rem; max-width: 520px; }
.portal-q.wide { max-width: none; }
.portal-q input[type=text], .portal-q input[type=email], .portal-q input[type=tel], .portal-q input[type=date],
.portal-q select, .portal-q textarea { padding: .45rem .55rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--field); color: var(--text); font: inherit; }
.portal-q textarea { width: 100%; box-sizing: border-box; }
.portal-q fieldset { border: 0; padding: 0; margin: 0; }
.portal-q legend { padding: 0; margin-bottom: .35rem; }
.portal-q fieldset > div { display: grid; gap: .3rem; }
.portal-q fieldset label { display: flex; gap: .45rem; align-items: flex-start; font-weight: normal; }
.portal-q fieldset input { margin-top: .2rem; }
.portal-q.scale { margin-bottom: .6rem; }
.portal-q.scale fieldset > div { display: flex; gap: 1.1rem; }
.portal-q fieldset label { overflow-wrap: anywhere; }
.portal-q.wide:has(input[type=checkbox]) fieldset > div { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.portal-q.has-error input, .portal-q.has-error select, .portal-q.has-error textarea { border-color: var(--danger); }
.portal-error { color: var(--danger); font-size: .88rem; }
.req { color: var(--danger); }
.portal-certify .check-inline { white-space: normal; align-items: flex-start; color: var(--text); }
.portal-certify .check-inline input { margin-top: .25rem; }
.portal-certify.has-error { outline: 2px solid var(--danger); }
.portal-actions { display: flex; gap: .6rem; flex-wrap: wrap; position: sticky; bottom: 0; padding: .75rem 0; background: var(--bg); }
.portal-errors ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.portal-errors a { color: inherit; }
.portal-q.wide select { max-width: 100%; }
/* Church portal (records/church_portal.py, templates/church_portal/) */
.portal-stack { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.portal-stack input:not([type=checkbox]), .portal-stack select, .portal-stack textarea, .portal-inline-form input, .portal-inline-form select {
  padding: .45rem .55rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field);
  color: var(--text); font: inherit; }
.portal-stack .portal-q { margin: 0; width: 100%; }
.portal-stack input[type=email], .portal-stack input[type=text], .portal-stack select { width: 100%; max-width: 360px; box-sizing: border-box; }
.portal-stack textarea { width: 100%; box-sizing: border-box; }
.portal-stack .code-input { font-size: 1.4rem; letter-spacing: .3em; max-width: 9em; }
.portal-inline-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.portal-inline-form label { display: flex; flex-direction: column; gap: .25rem; }
.portal-table { width: 100%; border-collapse: collapse; }
.portal-table th, .portal-table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.portal-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem 1.5rem; }
.portal-sections h3 { margin: 0 0 .25rem; }
.buildings-table th { font-size: .8rem; font-weight: 600; vertical-align: bottom; }
.buildings-table input[type=text] { width: 6.5rem; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--field); color: var(--text); font: inherit; }
.buildings-table td:has(input[type=checkbox]) { text-align: center; }
.portal-support { margin-top: 2rem; text-align: center; }
.portal-code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; white-space: nowrap; }
.portal-officer-pick { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; }
.portal-officer-pick label { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
dl.answers { display: grid; grid-template-columns: minmax(180px, 2fr) 3fr; gap: .4rem 1rem; margin: 0; }
dl.answers dt { color: var(--muted); }
dl.answers dd { margin: 0; }
@media (max-width: 600px) { dl.answers { grid-template-columns: 1fr; } dl.answers dd { margin-bottom: .4rem; } }
/* Local church officers: tick several offices, then one email (records/offices.html) */
.pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; position: sticky; top: 0; z-index: 5; }
.pick-bar .pick-count { margin-right: auto; }
.pick-bar select { padding: .35rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); color: var(--text); }
.pick-error { flex-basis: 100%; margin: 0; color: var(--danger); }
/* Files attached to a person or church (records/_attachments.html) */
.inline-form { display: inline; }
.attach-form { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-end; margin: .75rem 0 .25rem; }
.attach-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; }
.attach-form label.grow { flex: 1 1 14rem; }
.attach-form input[type=text] { min-width: 10rem; }
/* Tabs on person and church pages (static/records/page_tabs.js); printing shows every tab except Notes */
.page-tabs { display: flex; flex-wrap: wrap; gap: .1rem; border-bottom: 1px solid var(--line); margin: 0 0 1rem; }
.page-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: .55rem .9rem; font: inherit;
  color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.page-tabs button:hover { color: var(--text); }
.page-tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.page-tabs .count { font-size: .75rem; color: var(--muted); margin-left: .3rem; font-weight: 400; }
.tab-pick { display: none; }                     /* phones only: the tabs as a drop-down list (below) */
@media screen and (max-width: 600px) {
  .page-tabs { display: none; }
  .tab-pick { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; padding-bottom: .75rem;
    border-bottom: 1px solid var(--line); color: var(--muted); }
  .tab-pick select { flex: 1; font-size: 1rem; font-weight: 600; padding: .5rem .6rem; border-color: var(--accent); }
}
@media print {
  .tab-pane[hidden]:not(.tab-private) { display: block !important; }
  .tab-private { display: none !important; }
}
/* Notes and files (records/_notes.html) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notes-private { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: .4rem .75rem; font-size: .85rem; margin: 0 0 1rem; }
.note-form textarea { width: 100%; box-sizing: border-box; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; background: var(--panel); color: var(--text); }
.note-form-row { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: flex-end; margin: .5rem 0 1rem; }
.note-form-row label, .note-form > label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; }
.note-form label.check { flex-direction: row; align-items: center; gap: .35rem; }
.note-filters { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0 0 .5rem; }
.note-chip { font-size: .8rem; padding: .15rem .65rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); text-decoration: none; }
.note-chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.note-search { margin-left: auto; display: flex; gap: .35rem; }
.note-list { list-style: none; padding: 0; margin: 0; }
.note { border-top: 1px solid var(--line); padding: .7rem 0; }
.note-head { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.note-cat { font-size: .75rem; padding: .05rem .5rem; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.note-actions { margin-left: auto; font-size: .85rem; }
.note-text { margin-top: .35rem; }
.note-files { margin: .35rem 0 0; padding-left: 1.2rem; }
.schedule-row { align-items: center; margin: 1rem 0 .5rem; }
.template-bar { align-items: center; margin: 0 0 .75rem; }
.place-bar { align-items: center; margin: 0 0 .5rem; }
/* Feedback: the top-bar button (left of the account button) and the pages */
.topbar .feedback-button { display: inline-flex; align-items: center; gap: .35rem; color: #fff; font-size: .9rem;
  border: 1px solid rgba(255,255,255,.55); border-radius: 99px; padding: .25rem .75rem; white-space: nowrap; }
.topbar .feedback-button:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.count-badge { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 99px; background: #fff;
  color: var(--topbar); font-size: .78rem; font-weight: 700; text-align: center; line-height: 1.4; }
/* Help desk questions waiting in "To check" (records/feedback.py): a yellow tag beside the Help desk link */
.count-badge.to-check { background: var(--viewas-bg); color: var(--viewas-text); }
.to-check-banner { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.feedback-kinds { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; list-style: none; padding: 0; margin: .25rem 0; }
.feedback-kinds label { display: inline-flex; gap: .35rem; align-items: center; font-weight: 500; width: auto; white-space: nowrap;
  color: var(--text); font-size: 1rem; }
.feedback-kinds input { width: auto; margin: 0; }
.feedback-message { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem 1rem; }
.feedback-shot { max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); }
/* A request's conversation (records/feedback/detail.html): replies to them, staff notes, changes */
.feedback-entries { list-style: none; margin: 0 0 1rem; padding: 0; }
.feedback-entries li { margin: 0 0 .6rem; }
.feedback-entries .who { font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
.feedback-entries .feedback-message { margin: 0; }
.feedback-entries .entry-note .feedback-message { background: var(--warn-soft); border-color: var(--warn-soft); }
.feedback-entries .entry-reply .feedback-message { background: var(--accent-soft); border-color: var(--accent-soft); }
.feedback-entries .entry-change { font-size: .85rem; color: var(--muted); }
/* Statistics trends (records/reports/trends.html) */
.trend-lines summary { cursor: pointer; font-weight: 600; margin: .5rem 0; }
.trend-lines fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: .5rem 0; }
.trend-line-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .15rem 1rem; }
.trend-line-list label { display: flex; gap: .4rem; align-items: baseline; font-weight: normal; }
.trend-line-list input { width: auto; margin: 0; }
.trend-lines input[type=search] { width: 100%; max-width: 420px; }
.trend-same td { color: var(--muted); border-top: 0; }
.trend-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 0 1rem; }
.trend-charts h2 { font-size: 1rem; }
/* The portals' sign-in question form: a box only spam robots fill in (records/templates/portal/_public_help.html) */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.feedback-assign { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: .3rem 0 .8rem; }
.feedback-assign label { display: flex; gap: .35rem; align-items: center; font-weight: normal; }
.feedback-assign input { width: auto; margin: 0; }
.assign-pick { position: relative; display: inline-block; }
.assign-pick > summary { cursor: pointer; list-style: none; border-radius: 4px; padding: 0 .2rem; }
.assign-pick > summary::-webkit-details-marker { display: none; }
.assign-pick > summary:hover { background: var(--accent-soft); }
.assign-edit { color: var(--muted); font-size: .85em; margin-left: .2rem; }
.assign-pop { position: absolute; z-index: 20; top: 100%; right: 0; min-width: 14rem; max-width: 80vw; margin-top: .25rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px var(--shadow-strong);
  padding: .6rem .8rem; white-space: normal; }
.assign-pop .feedback-assign { flex-direction: column; margin: 0 0 .6rem; }
.assign-pop small { display: block; margin-top: .4rem; }
.fields .assign-pop { left: 0; right: auto; }
.report-table .assign-pop { position: static; box-shadow: none; min-width: 11rem; }  /* the table scrolls: open in the row */
@media print { .assign-edit, .assign-pop { display: none !important; } }
.status-new { background: var(--warn-soft); color: var(--warn); }
.status-in_progress { background: var(--accent-soft); color: var(--accent); }
.status-done { background: var(--good-soft); color: var(--good); }
.status-wont_do { background: var(--bg); color: var(--muted); }
.status-to_check { background: var(--violet-soft); color: var(--violet); }
@media (max-width: 640px) { .topbar .feedback-button span { display: none; } }
/* The Feedback pop-up and its "Back to feedback" button while a screenshot is taken */
.feedback-dialog { width: min(560px, calc(100% - 2rem)); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text); padding: 1rem 1.25rem; box-shadow: 0 12px 40px var(--shadow-strong); }
.feedback-dialog::backdrop { background: rgba(0,0,0,.35); }
.feedback-head { display: flex; justify-content: space-between; align-items: center; }
.feedback-head h2 { margin: 0; }
.feedback-x { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 .25rem; }
.feedback-label { display: block; font-weight: 600; margin: .5rem 0 .25rem; }
.feedback-dialog textarea, .feedback-dialog select { width: 100%; font: inherit; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--field); color: var(--text); }
.feedback-shot-area { margin-top: .75rem; }
.feedback-shot-area p { margin: .2rem 0; }
.feedback-preview { display: flex; gap: .5rem; align-items: flex-start; margin-top: .4rem; }
.feedback-preview img { max-width: 70%; max-height: 180px; border: 1px solid var(--line); border-radius: 4px; }
.link-like { color: var(--accent); text-decoration: underline; cursor: pointer; }
.feedback-error { color: var(--error); margin: .5rem 0 0; }
.feedback-return { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; background: var(--accent); color: var(--on-accent);
  border: 0; border-radius: 99px; padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 18px var(--shadow-strong); }
/* Settings page */
.settings-section { margin-bottom: 1rem; max-width: 60rem; }
.settings-section h2 { margin-top: 0; }
.theme-choice.settings-theme { border: 0; padding: 0; margin: 0; }
.settings-theme button { padding: .3rem .9rem; border: 1px solid var(--line); border-radius: 99px; background: var(--panel);
  color: var(--text); font: inherit; cursor: pointer; }
.settings-theme button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
/* Compose pages: the editor gets the full width, recipients below it in columns */
.compose-stack { display: grid; gap: 1rem; }
.compose-stack .recipient-list { columns: 20rem; column-gap: 2rem; max-height: 22rem; }
.compose-stack .recipient-list li { break-inside: avoid; }
.email-compose textarea { width: 100%; font: inherit; }
.email-compose input[type=text] { width: 100%; }
.email-body { white-space: normal; line-height: 1.5; overflow-x: auto; }
.email-body img { max-width: 100%; height: auto; }
button.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
h2 .btn.small { margin-left: .5rem; vertical-align: middle; }
.email-preview { border-color: var(--accent); }
.email-preview h2 { margin: 0; }
.preview-body { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; background: var(--bg); margin: .5rem 0 .75rem; }
/* Church maps (district and charge pages) */
.church-map { height: 420px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
/* Every map (asset map too): keep Leaflet's layers (z-index 400–1000) inside the map, under menus and pop-ups */
.leaflet-container { z-index: 0; }
@media (max-width: 600px) { .church-map { height: 320px; } }
@media print { .church-map { height: 5in; } }
.church-map.tall { height: 560px; }
.church-pin { background: none; border: 0; }
.church-pin svg { display: block; filter: drop-shadow(0 0 1px rgba(0,0,0,.45)); }
.map-legend { list-style: none; padding: 0; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.map-legend label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.map-swatch { display: inline-flex; width: 16px; height: 16px; }
.view-as-bar { background: var(--viewas-bg); color: var(--viewas-text); padding: .5rem 1rem; display: flex; gap: .5rem 1rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.view-as-bar form { margin: 0; }
.code-box { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; white-space: pre-wrap; word-break: break-all; font-size: .9rem; }
/* Cabinet appointment board (records/cabinet.py) */
.cab-banner { background: var(--cab-bg); color: var(--cab-text); border-radius: var(--radius); padding: .5rem .9rem; margin-bottom: 1rem; font-size: .9rem; display: flex; gap: .4rem 1rem; flex-wrap: wrap; justify-content: space-between; }
.cab-banner strong { text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; }
.cab-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.cab-tabs a { padding: .45rem .8rem; color: var(--muted); border-bottom: 3px solid transparent; }
.cab-tabs a.here { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.cab-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.cab-summary div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .85rem; }
.cab-summary b { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.cab-summary span { color: var(--muted); font-size: .85rem; }
.cab-summary .alert b { color: var(--bad); }
.cab-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.cab-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.cab-col > header { padding: .65rem .9rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.cab-card { display: grid; gap: .25rem; padding: .65rem .9rem; border-bottom: 1px solid var(--line); color: var(--text); }
.cab-card:last-child { border-bottom: 0; }
.cab-card:hover { background: var(--accent-soft); text-decoration: none; }
.cab-card .top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.cab-card .name { font-weight: 600; color: var(--accent); }
.cab-card .sub { color: var(--muted); font-size: .85rem; }
.chips { display: flex; gap: .3rem; flex-wrap: wrap; }
.chip { font-size: .75rem; padding: .05rem .5rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
/* Cabinet profile search (records/cabinet_search.py) */
.cab-presets { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .8rem; }
.cab-presets .chip { font-size: .82rem; padding: .2rem .65rem; }
.cab-search { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
.cab-search select { max-width: 100%; min-width: 0; }
.cab-search-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cab-search-row input[type=search] { flex: 1 1 18rem; min-width: 0; }
.cab-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem; }
.cab-filter { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cab-filter select[name=fq] { flex: 2 1 16rem; min-width: 0; max-width: 100%; }
.cab-filter input[name=fv] { flex: 1 1 10rem; min-width: 0; }
.cab-result { cursor: default; }
.cab-hits { margin: .2rem 0 0; display: grid; gap: .15rem; font-size: .88rem; }
.cab-hits dt { color: var(--muted); font-size: .8rem; }
.cab-hits dd { margin: 0 0 .25rem; overflow-wrap: anywhere; }
.cab-hits mark, .cab-answers mark { background: var(--warn-soft); color: inherit; padding: 0 .1em; border-radius: 2px; }
.cab-links { font-size: .82rem; }
.cab-answers { display: grid; grid-template-columns: minmax(10rem, 22rem) 1fr; gap: .35rem 1rem; margin: 0; }
.cab-answers dt { color: var(--muted); font-size: .88rem; }
.cab-answers dd { margin: 0; overflow-wrap: anywhere; }
@media screen and (max-width: 600px) { .cab-answers { grid-template-columns: 1fr; } .cab-answers dd { margin-bottom: .4rem; } }
.cab-state { font-size: .78rem; font-weight: 600; white-space: nowrap; }
.cab-state.needs { color: var(--bad); }
.cab-state.interest { color: var(--warn); }
.cab-state.proposed { color: var(--violet); }
.cab-state.agreed { color: var(--good); }
.cab-proposal { background: var(--violet-soft); border-radius: var(--radius); padding: .65rem .8rem; margin: .75rem 0; display: flex; gap: .5rem 1rem; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.cab-proposal form { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
.cab-match { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem; display: grid; gap: .35rem; }
.cab-match .top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cab-matches { display: grid; gap: .5rem; }
.fit { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: .35rem; }
.fit i { width: 8px; height: 8px; border-radius: 2px; background: var(--line); }
.fit i.on { background: var(--good); }
.cab-step { display: grid; grid-template-columns: 1.4rem 1fr; gap: .5rem; padding: .5rem 0; border-top: 1px dashed var(--line); }
.cab-step:first-of-type { border-top: 0; }
.cab-step .arrow { color: var(--violet); font-weight: 700; text-align: center; }
.cab-step .row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.cab-step form { display: inline-flex; gap: .3rem; margin: 0; }
.open-end { color: var(--bad); }
.filled-end { color: var(--good); }
.layout-2col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .layout-2col { grid-template-columns: 1fr; } }
.public-page { max-width: 640px; margin: 0 auto; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; max-height: 520px; overflow-y: auto; padding: .25rem; }
.template-card { display: grid; gap: .35rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; cursor: pointer; background: var(--panel); font-size: .85rem; }
.template-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.template-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 4px; background: var(--bg); }
/* Our templates: a shrunken live copy of the email (600px wide, scaled to the card) */
.template-card .thumb { display: block; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; position: relative; border-radius: 4px; background: #fff; }
.template-card .thumb iframe { position: absolute; top: 0; left: 0; width: 600px; height: 800px; border: 0; transform: scale(.25);
  transform-origin: 0 0; pointer-events: none; }
.template-card .small-link { font-size: .8rem; }
/* Search results: a summary line, people and churches side by side, the rest in a row of smaller boxes */
.search-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.search-summary a { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: .2rem .75rem; color: var(--text); font-size: .9rem; }
.search-summary a:hover { border-color: var(--accent); text-decoration: none; }
.search-summary b { color: var(--accent); margin-left: .2rem; font-variant-numeric: tabular-nums; }
.search-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.search-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; align-items: start; }
.search-head { display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.search-head h2 { margin: 0; }
.search-head .btn { margin-left: .2rem; }
.result-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.result-list li { padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.result-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.panel { scroll-margin-top: 1rem; }
.search-more { margin-top: 1rem; }

/* Top bar in two lines: the brand and records menu, then the tools menu (left) with search and the user (right) */
.topbar .row-break { flex-basis: 100%; height: 0; }
.topbar .row-break ~ * { margin-top: -.3rem; }   /* the line break adds a second row gap: take it back so the search sits centered */
.topbar nav.tools { flex: 0 1 auto; font-size: .92rem; margin-left: auto; }   /* tools at the right of the second line */
.topbar nav.tools a { opacity: .9; }
.topbar nav.tools:empty { display: none; }
.topbar .inner { row-gap: .45rem; }
/* Account button (top right): conference logo and the person's picture or initials, opening a small menu */
.topbar .account { position: relative; }
.topbar .account > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem;
  background: #fff; border-radius: 99px; padding: .2rem .25rem .2rem .7rem; }
.topbar .account > summary::-webkit-details-marker { display: none; }
.topbar .account > summary:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.account-logo { color: var(--accent); font-weight: 700; font-size: .8rem; white-space: nowrap; }
.account-logo img { height: 32px; width: auto; display: block; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center;
  justify-content: center; }
.avatar.initials { background: #2a78d6; color: #fff; font-weight: 600; font-size: .85rem; }
.avatar.big { width: 44px; height: 44px; font-size: 1rem; }
.account-menu { position: absolute; right: 0; top: calc(100% + .4rem); background: var(--panel); color: var(--text); min-width: 240px;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px var(--shadow-strong); padding: .5rem; z-index: 20;
  display: grid; gap: .1rem; }
.account-who { display: flex; gap: .6rem; align-items: center; padding: .4rem .5rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.account-who .muted { font-size: .85rem; word-break: break-all; }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: .45rem .5rem; border-radius: 6px;
  color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--accent-soft); text-decoration: none; }
.account-menu form { margin: 0; }
.account-menu { max-height: calc(100vh - 5rem); overflow-y: auto; }
.account-tools { display: grid; gap: .1rem; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }
.account-tools:not(:has(a)) { display: none; }
.account-heading { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .3rem .5rem .1rem; }

/* Dark theme details: emails and the logo pill stay white (they're designed for white), fields follow the theme */
.email-body { background: #fff; color: #222; border-radius: var(--radius); padding: .75rem 1rem; }
textarea, select, input[type=text], input[type=email], input[type=search], input[type=date], input[type=number] { color: inherit; }
.theme-choice { display: flex; gap: .25rem; padding: .35rem .5rem .5rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }

/* Export builder (records/exports.py, templates/records/export.html) */
.export-callout { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; border-color: var(--accent); }
.export-callout > div { flex: 1 1 420px; }
.export-callout h2 { margin-bottom: .25rem; }
.export-saved-row, .export-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.export-head h2 { margin: 0; }
.export-head { margin-bottom: .75rem; }
.export-grow { flex-grow: 1; }
.export-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .3rem .7rem; color: var(--text); background: var(--panel); }
.export-chip:hover { text-decoration: none; border-color: var(--accent); }
.export-chip.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.export-tag { font-size: .72rem; padding: .05rem .45rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 400; }
.export-tag.mine { background: var(--good-soft); color: var(--good); }
.export-save { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; margin-top: .9rem; padding: .9rem 1rem; background: var(--accent-soft); border-radius: var(--radius); }
.export-delete { margin-top: .6rem; display: flex; gap: .6rem; align-items: center; }
.export-field { display: flex; flex-direction: column; gap: .2rem; font-weight: 600; font-size: .9rem; }
.export-field input, .export-field select { font-weight: 400; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); color: var(--text); min-width: 13rem; }
.export-save .export-field { flex: 1 1 18rem; }
.export-check { display: inline-flex; align-items: center; gap: .4rem; }
.step { color: var(--accent); }
.export-kinds { display: flex; flex-wrap: wrap; gap: .5rem; }
.export-kind { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem .9rem; cursor: pointer; color: var(--accent); background: var(--panel); }
.export-kind.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.export-kind input { margin: 0; }
.export-help { margin: .6rem 0 0; }
.export-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.export-group { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .8rem .7rem; display: flex; flex-direction: column; gap: .1rem; }
.export-group legend { font-weight: 700; padding: 0 .3rem; }
.export-group.locked { background: var(--warn-soft); border-color: var(--warn-soft); }
.export-group.locked .export-col { color: var(--muted); cursor: not-allowed; }
.export-lock { display: flex; align-items: center; gap: .35rem; color: var(--warn); font-size: .85rem; margin: 0 0 .3rem; }
.export-yearly { margin: 0 0 .2rem; }
.export-col { display: flex; align-items: center; gap: .45rem; padding: .12rem 0; cursor: pointer; }
.export-filters { display: flex; flex-wrap: wrap; gap: .9rem; }
.export-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.export-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }
.export-table-wrap { border: 1px solid var(--line); border-radius: var(--radius); }
.export-table th, .export-table td { white-space: nowrap; }
.export-empty { padding: 1.5rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); margin: 0; }
.export-multi-field { border: 0; padding: 0; margin: 0; flex: 1 1 100%; min-width: 0; }
.export-multi-field legend { padding: 0; margin-bottom: .3rem; font-weight: 600; font-size: .9rem; }
.export-multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .15rem 1.25rem;
  max-height: 18rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; background: var(--field); }
.export-multi label { display: flex; align-items: flex-start; gap: .45rem; padding: .15rem 0; cursor: pointer; line-height: 1.3; }
.export-multi input { flex: none; margin: .15rem 0 0; width: auto; min-width: 0; padding: 0; }

/* Charge conference forms (records/charge_conference.py) */
.badge.wait { background: var(--violet-soft); color: var(--violet); }
.cc-grid .label { font-weight: 600; }
.cc-grid .portal-table th, .cc-grid .portal-table td { padding: .3rem .4rem; }
.cc-grid .portal-table thead th { font-size: .85rem; }
.cc-grid .portal-table tbody th { font-weight: normal; font-size: .9rem; }
.cc-grid input[type=text] { width: 5.5rem; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--field); color: var(--text); font: inherit; }
.cc-grid td.has-error input { border-color: var(--danger); }
/* words (addresses, names) get the room; numbers and dollars a fixed width */
.cc-grid td.cc-cell-text { min-width: 14rem; }
.cc-grid td.cc-cell-text input[type=text] { width: 100%; box-sizing: border-box; }
.cc-grid td.cc-cell-money input[type=text], .cc-grid td.cc-cell-calc input[type=text] { width: 8rem; }
.cc-grid[data-grow] .portal-table tbody th { width: 1%; white-space: nowrap; }
/* lists with many columns (Form 09's funds): each line a block of labeled boxes, two to a row */
.cc-cards .portal-table thead { display: none; }
.cc-cards .portal-table, .cc-cards .portal-table tbody { display: block; }
.cc-cards .portal-table tr[data-row] { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .8rem; padding: .6rem 0;
  border-bottom: 1px solid var(--line); }
.cc-cards .portal-table tbody th { grid-column: 1 / -1; border: 0; padding: 0; font-weight: 600; }
.cc-cards .portal-table td { border: 0; padding: 0; min-width: 0; }
.cc-cards .portal-table td::before { content: attr(data-label); display: block; font-size: .85rem; color: var(--muted); margin-bottom: .15rem; }
.cc-cards td input[type=text] { width: 100% !important; box-sizing: border-box; }
@media screen and (max-width: 600px) { .cc-cards .portal-table tr[data-row] { grid-template-columns: 1fr; } }
.cc-grid .cc-add-row { margin-top: .4rem; width: auto; justify-self: start; align-self: flex-start; }
.cc-forms td { vertical-align: middle; }
.cc-forms .cc-action { text-align: right; white-space: nowrap; }
.cc-comments { margin-top: .35rem; padding: .4rem .6rem; border-left: 3px solid var(--warn); background: var(--warn-soft); color: var(--text); }
.cc-answers dt { color: var(--muted); font-size: .88rem; margin-top: .6rem; }
.cc-answers dd { margin: .1rem 0 0; white-space: pre-line; }
.cc-answers .portal-table { margin: .6rem 0; }
.cc-answers .portal-table th, .cc-answers .portal-table td { padding: .3rem .4rem; font-size: .9rem; }
.cc-history { list-style: none; padding: 0; margin: 0; }
.cc-history li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.cc-decide { display: grid; gap: .6rem; }
.cc-decide textarea { width: 100%; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--field); color: var(--text); font: inherit; }
.cc-filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.cc-filters label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--muted); }
.cc-filters select { padding: .35rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); color: var(--text); font: inherit; }
.cc-send-back { margin: .75rem 0; }
.cc-grid .portal-table tbody th, .cc-answers .portal-table tbody th { text-transform: none; letter-spacing: normal; color: var(--text); }
.portal-preview { max-width: 860px; }
.cc-files { list-style: none; padding: 0; margin: .3rem 0 0; display: grid; gap: .3rem; }
.cc-files li { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.cc-files .check-inline { font-size: .85rem; }
.portal-q.wide.one-column:has(input[type=checkbox]) fieldset > div { grid-template-columns: 1fr; }
.cc-preview-list { list-style: none; padding: 0; margin: 0; }
.cc-preview-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .75rem; flex-wrap: wrap; align-items: baseline; }
.cc-preview-list li:last-child { border-bottom: 0; }
.cc-filters select { max-width: 15rem; }
.cc-fold > summary { cursor: pointer; list-style: none; display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.cc-fold > summary::-webkit-details-marker { display: none; }
.cc-fold > summary h2 { margin: 0; display: inline; }
.cc-fold > summary::before { content: "▸"; color: var(--muted); }
.cc-fold[open] > summary::before { content: "▾"; }
.cc-fold[open] > summary { margin-bottom: .75rem; }
.cc-count { font-size: .85rem; }
.cc-count.done { color: var(--good); }
.portal-q[data-attention] fieldset > div { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.cc-attention { border-left: 4px solid var(--warn); }
.cc-skip { margin-top: .3rem; }
.portal-q input.cc-calc { background: var(--bg); border-style: dashed; font-weight: 600; max-width: 12rem; }

/* Asset map (records/asset_map.py): the map + list (public /map/ and staff /asset-map/), church cards, the form */
.am-app { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: min(80vh, 780px); min-height: 520px;
  position: relative; }
/* A church's details pop out over the right of the map (owner, Nov 2026); phones: the whole screen (below) */
.am-detail { position: absolute; z-index: 5; top: .6rem; right: .6rem; bottom: .6rem; width: min(380px, calc(100% - 1.2rem));
  overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px var(--shadow-strong); }
.am-detail[hidden] { display: none; }
.am-detail-close { position: sticky; top: .5rem; float: right; margin: .5rem .5rem -2.5rem 0; z-index: 1; width: 2rem; height: 2rem;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 1.3rem; line-height: 1;
  cursor: pointer; box-shadow: 0 2px 6px var(--shadow); }
.am-detail-close:hover { background: var(--accent-soft); }
.am-item[aria-current=true] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.am-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); overflow-y: auto; }
.am-side .am-listhead { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.am-search { display: grid; gap: .7rem; padding: .85rem; border-bottom: 1px solid var(--line); }
.am-field { display: grid; gap: .25rem; }
.am-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.am-label small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.am-search input, .am-search select { padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--field); color: var(--text); font: inherit; min-width: 0; }
.am-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.am-row > input, .am-row > select { flex: 1 1 7rem; }
.am-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.am-chip { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 99px; padding: .2rem .65rem;
  font: inherit; font-size: .85rem; cursor: pointer; }
.am-chip[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.am-chip.mission[aria-pressed=true] { background: var(--good); border-color: var(--good); }
/* Filters pop-out over the list (the chips used to fill the side) */
.am-search { position: relative; }
.am-filter-btn { display: inline-flex; align-items: center; gap: .35rem; flex: none; }
.am-filter-btn[aria-expanded=true] { background: var(--accent-soft); }
.am-filter-n { font-weight: 700; }
.am-active { display: flex; flex-wrap: wrap; gap: .3rem; }
.am-tag { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--accent); background: var(--accent-soft);
  color: var(--text); border-radius: 99px; padding: .1rem .3rem .1rem .6rem; font: inherit; font-size: .82rem; cursor: pointer; }
.am-tag:hover .am-tag-x, .am-tag:focus-visible .am-tag-x { background: var(--accent); color: var(--on-accent); }
.am-tag-x { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; font-size: .9rem; line-height: 1; }
.am-pop { position: fixed; z-index: 30; display: grid; gap: .8rem; align-content: start; box-sizing: border-box;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px var(--shadow-strong);
  padding: .8rem; overflow-y: auto; }
.am-pop[hidden] { display: none; }
/* In the pop-out the choices are a list, one per line, with a tick box (owner: not bubbles) */
.am-pop .am-chips { display: grid; gap: 0; }
.am-pop .am-chip, .am-pop .am-chip.mission { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left;
  border: 0; border-radius: 6px; background: none; color: var(--text); padding: .35rem .4rem; font-size: .92rem; }
.am-pop .am-chip:hover, .am-pop .am-chip:focus-visible { background: var(--accent-soft); }
.am-pop .am-chip::before { content: ""; flex: none; width: 1rem; height: 1rem; border: 2px solid var(--muted); border-radius: 3px;
  box-sizing: border-box; display: grid; place-items: center; font-size: .75rem; line-height: 1; font-weight: 700; }
.am-pop .am-chip[aria-pressed=true], .am-pop .am-chip.mission[aria-pressed=true] { background: none; color: var(--text); font-weight: 600; }
.am-pop .am-chip[aria-pressed=true]::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.am-pop .am-chip.mission[aria-pressed=true]::before { background: var(--good); border-color: var(--good); }
.am-pop-head, .am-pop-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.am-pop-foot { position: sticky; bottom: -.8rem; background: var(--panel); padding: .5rem 0 0; border-top: 1px solid var(--line); }
.am-listhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem .6rem; padding: .45rem .85rem;
  font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.am-listhead label { display: inline-flex; gap: .3rem; align-items: center; cursor: pointer; }
.am-list { flex: 1 0 auto; }
.am-item { display: grid; gap: .1rem; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text); font: inherit; padding: .6rem .85rem; cursor: pointer; }
.am-item:hover, .am-item:focus-visible { background: var(--accent-soft); }
.am-item-sub, .am-item-mins { font-size: .82rem; color: var(--muted); }
.am-item-mission { color: var(--good); font-weight: 600; }
.am-dist { float: right; font-size: .8rem; color: var(--accent); font-weight: 600; }
.am-empty { padding: 1rem .85rem; color: var(--muted); margin: 0; }
.am-back { padding: .7rem .85rem 0; }
.am-map { min-width: 0; min-height: 0; background: var(--bg); }
.am-card-photo { height: 160px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; overflow: hidden; }
.am-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.am-card-body { display: grid; gap: .55rem; padding: .75rem .85rem 1rem; }
.am-card h2 { margin: 0; font-size: 1.15rem; }
.am-card h3 { margin: .2rem 0 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.am-card-addr { font-size: .88rem; color: var(--muted); }
.am-card-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .6rem; margin: 0; font-size: .9rem; }
.am-card-meta dt { color: var(--muted); }
.am-card-meta dd { margin: 0; overflow-wrap: anywhere; }
.am-card-min { border: 1px solid var(--line); border-radius: 6px; padding: .45rem .6rem; font-size: .9rem; }
.am-card-min p, .am-card-mission p { margin: .2rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.am-card-mission { background: var(--good-soft); border-radius: 6px; padding: .5rem .65rem; font-size: .9rem; }
.am-card-mission strong { color: var(--good); }
.am-card-staff { background: var(--violet-soft); border-radius: 6px; padding: .5rem .65rem; font-size: .88rem; display: grid; gap: .2rem; }
.am-card-staff-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--violet); font-weight: 600; }
.am-card-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.am-manage { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 1rem; margin-top: 1rem; align-items: start; }
.am-manage h2 { margin-top: 0; font-size: 1.05rem; }
.am-recent { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.am-recent li { padding: .25rem 0; border-bottom: 1px solid var(--line); }
/* The public page (no staff top bar; embedded on susumc.org with ?embed) */
.am-public-main { max-width: 1400px; margin: 0 auto; padding: 1rem max(16px, env(safe-area-inset-right, 0px)) 1rem max(16px, env(safe-area-inset-left, 0px)); }
.am-embed .am-public-main { padding: 0; max-width: none; }
.am-embed .am-app { border-radius: 0; }
.am-embed .am-public-foot { padding: 0 .85rem; }
.am-public-head { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .9rem; }
.am-public-head h1 { margin: 0; font-size: 1.5rem; }
.am-public-head p { margin: .2rem 0 0; color: var(--muted); max-width: 70ch; }
/* The form (church portal and the church page's Asset map tab) with its live preview */
.am-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 1rem; align-items: start; }
.am-switch { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; }
.am-switch input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; }
.am-switch span { display: grid; gap: .2rem; }
.am-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.am-grid .portal-q { max-width: none; }
.am-grid input { width: 100%; box-sizing: border-box; }
.am-grid .label { font-weight: 600; }
.am-readonly { padding: .45rem .55rem; background: var(--bg); border-radius: var(--radius); }
.am-photo { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.am-photo .portal-q { margin: 0; }
.am-thumb { width: 160px; height: 105px; border-radius: var(--radius); background: var(--accent-soft); display: grid; place-items: center; overflow: hidden; flex: none; }
.am-thumb img { width: 100%; height: 100%; object-fit: cover; }
.am-ticks { display: grid; gap: .4rem; }
.am-tick { border: 1px solid var(--line); border-radius: 6px; padding: .45rem .65rem; }
.am-tick.on { border-color: var(--accent); background: var(--accent-soft); }
.am-tick > label { display: flex; gap: .5rem; align-items: center; font-weight: 600; cursor: pointer; }
.am-tick textarea, .am-other input { width: 100%; box-sizing: border-box; padding: .4rem .5rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--field); color: var(--text); font: inherit; }
.am-more { margin-top: .4rem; }
.am-other { display: grid; gap: .4rem; }
.am-other-head { display: flex; gap: .6rem; align-items: center; }
.am-sub { font-size: .95rem; margin: 1rem 0 .4rem; }
.am-preview { position: sticky; top: .75rem; }
.am-preview .panel { padding: 0; overflow: hidden; }
.am-preview-head { padding: .55rem .85rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border-bottom: 1px solid var(--line); }
.am-preview-off { margin: 0; padding: .55rem .85rem; background: var(--warn-soft); color: var(--warn); font-size: .88rem; }
@media screen and (max-width: 980px) {
  .am-form-layout { grid-template-columns: minmax(0, 1fr); }
  .am-preview { position: static; }
}
@media screen and (max-width: 760px) {
  .am-app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 380px auto; height: auto; min-height: 0; }
  .am-map { grid-row: 1; }
  .am-side { border-right: 0; border-top: 1px solid var(--line); max-height: 75vh; }
  .am-detail { position: fixed; inset: 0; width: auto; border-radius: 0; border: 0; z-index: 40; }
  .am-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print { .am-app { height: auto; } .am-list { overflow: visible; } }

/* Phones: nothing here changes wider screens or printouts */
@media screen and (max-width: 760px) {
  /* Top bar: brand + Menu + feedback + account on the first line, the search under it, then the two menu lines,
     so nothing runs off the right edge (it made every staff page wider than the phone) */
  .topbar .inner { gap: .45rem .9rem; }
  .topbar .brand { margin-right: auto; }
  .topbar nav, .topbar nav.tools { flex: 1 1 100%; flex-wrap: wrap; gap: .3rem .9rem; margin-left: 0; order: 2; }
  .topbar .row-break { display: none; }
  .topbar .row-break ~ * { margin-top: 0; }
  .topbar form.search { flex: 1 1 100%; order: 1; }
  .topbar input[type=search] { width: 100%; max-width: none; }
  /* Menu button (base.html): both menu lines folded away until it's tapped, then two columns of big tap targets */
  .topbar.has-menu .menu-button { display: inline-flex; }
  .topbar.has-menu:not(.menu-open) nav { display: none; }
  .topbar.has-menu nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
  .topbar.has-menu nav a { padding: .45rem 0; }
  .topbar.has-menu nav.tools { border-top: 1px solid rgba(255,255,255,.3); padding-top: .3rem; }
  .topbar.menu-open .menu-button { background: rgba(255,255,255,.2); }
}
@media screen and (max-width: 480px) { .topbar .account-logo { display: none; } }   /* keeps the first line to one line */
.topbar .menu-button { display: none; align-items: center; gap: .35rem; color: #fff; background: none; font-size: .9rem;
  border: 1px solid rgba(255,255,255,.55); border-radius: 99px; padding: .25rem .75rem; cursor: pointer; }
@media screen and (max-width: 600px) {
  .section-head { flex-wrap: wrap; }                          /* buttons go under a long name instead of squeezing it */
  .form-actions { flex-wrap: wrap; }
  form.filters select, form.filters input { max-width: 100%; }
  dl.form-answers { grid-template-columns: minmax(0, 1fr); }  /* long questions above their answers */
  dl.form-answers dd { margin-bottom: .4rem; }
  input[type=radio], input[type=checkbox] { width: 1.15rem; height: 1.15rem; }   /* easier to tap */
  /* Church portal forms list: the form's name on its own line, status and button below it */
  .cc-forms, .cc-forms tbody { display: block; }
  .cc-forms tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: .75rem;
    padding: .5rem 0; border-bottom: 1px solid var(--line); }
  .cc-forms td { border-bottom: 0; padding: .15rem 0; }
  .cc-forms td:first-child { grid-column: 1 / -1; }
  .cc-forms .cc-action { white-space: normal; }
}
