/* Compass - Catholic Scouting America palette tokens preserved from the legacy compass.css (lines 2-12). */
:root {
  --csa-green: #1f533b;
  --csa-green-dark: #123a28;
  --csa-green-light: #e8f0ec;
  --csa-gold: #ceb455;
  --csa-gold-light: #f4ecd0;
  --ink: #18231e;
  --muted: #5c6b63;
  --cream: #f8f6ef;
  --white: #fff;
  --focus: #1f533b;
  --focus-on-dark: #e3c95e;
  --danger: #8a1c1c;
  --danger-light: #f8e7e7;
  --line: #dfe5e1;
  --radius: 6px;
  --space: 1rem;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* the attribute wins over any display rule (e.g. .form-field's flex) */
/* Form controls share one height and type size: 40px with a mouse or trackpad, 44px for fingers (owner decision,
   2026-10-01). In px, not rem, so they do not grow with the wide-screen type scale; text never under 16px, or iOS
   zooms into the field on focus. */
:root { --control-h: 40px; --control-font: max(16px, .9rem); }
@media (pointer: coarse) { :root { --control-h: 44px; } }
html { -webkit-text-size-adjust: 100%; font-size: 100%; }
/* Larger type on wide desktop screens (easier to read and to present); everything sized in rem grows with it. */
@media (min-width: 1280px) { html { font-size: 112.5%; } }
@media (min-width: 1680px) { html { font-size: 125%; } }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--cream); line-height: 1.5; font-size: 1rem; }
a { color: var(--csa-green); text-underline-offset: 2px; }
a:hover { color: var(--csa-green-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); color: var(--csa-green-dark); line-height: 1.2; font-weight: 600; }
h1 { font-size: 1.75rem; margin: 0 0 .25rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
h3, .as-h3 { font-size: 1.05rem; margin: 1.25rem 0 .35rem; font-family: var(--font); }
p { margin: .4rem 0 .9rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }

/* Header and navigation */
.site-header { background: var(--white); border-bottom: 3px solid var(--csa-gold); }
.header-inner { max-width: 70rem; margin: 0 auto; padding: .4rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { width: 12.5rem; height: auto; display: block; }  /* 200px, larger on wide screens */
@media (max-width: 640px) { .brand img { width: 10rem; } }
.context-form label { white-space: nowrap; }
.env-badge { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--csa-green-dark); background: var(--csa-gold-light); border: 1px solid var(--csa-gold); padding: .1rem .45rem; border-radius: 999px; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.context-form { display: flex; align-items: center; gap: .35rem; }
.context-form label { font-size: .8rem; color: var(--muted); }
.context-form select { height: var(--control-h); padding: 0 .4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); font: inherit; font-size: var(--control-font); max-width: 12rem; }
.main-nav { background: var(--csa-green); }
.nav-inner { max-width: 70rem; margin: 0 auto; padding: 0 1rem; }
.nav-toggle { display: none; background: none; border: 0; color: var(--white); padding: .6rem 0; min-height: 44px; font-weight: 600; }
.nav-toggle:hover { background: none; color: var(--csa-gold-light); }
.nav-toggle:focus-visible { outline-color: var(--focus-on-dark); }
.main-nav ul { list-style: none; margin: 0; padding: 0 0 .5rem; display: flex; flex-direction: column; }
.main-nav a, .main-nav summary { display: flex; align-items: center; gap: .45rem; color: var(--white); text-decoration: none; padding: .55rem .25rem; }
.main-nav a:hover, .main-nav a[aria-current="page"], .main-nav summary:hover { color: var(--csa-gold-light); text-decoration: underline; }
.main-nav a:focus-visible, .main-nav summary:focus-visible { outline: 3px solid var(--focus-on-dark); outline-offset: 2px; }
.main-nav .nav-more ul { padding: 0 0 0 1.6rem; }  /* phone: the More items open in place, indented */
@media (max-width: 899px) {
  .js .nav-toggle { display: inline-flex; }
  .js .main-nav #nav-list { display: none; }
  .js .main-nav #nav-list.open { display: flex; }
}
@media (min-width: 900px) {
  .main-nav #nav-list { flex-direction: row; gap: 1.25rem; padding: 0; }
  .main-nav .nav-more { margin-left: auto; }
  .main-nav .nav-more ul { position: absolute; top: 100%; right: 0; z-index: 30; min-width: 14rem; padding: .35rem 0;
    background: var(--csa-green-dark); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 8px 18px rgba(18, 35, 30, .22); }
  .main-nav .nav-more ul a { padding: .55rem 1rem; }
}

/* Icons (Lucide, decorative: the text beside each one names the link) and drop-down menus. */
.icon { flex: none; width: 1.125rem; height: 1.125rem; }
.menu-drop { position: relative; }
.menu-drop > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .4rem; min-height: 44px; }
.menu-drop > summary::-webkit-details-marker { display: none; }
.menu-drop > summary > .icon:last-child { width: .875rem; height: .875rem; transition: transform .15s; }
.menu-drop[open] > summary > .icon:last-child { transform: rotate(180deg); }
.menu-drop > ul { list-style: none; margin: 0; }
.help-link { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; }
.account-menu > summary { color: var(--csa-green-dark); font-size: .9rem; border-radius: var(--radius); padding: 0 .35rem; }
.account-menu > summary:hover { background: var(--csa-green-light); }
.account-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu > ul { position: absolute; right: 0; top: 100%; z-index: 30; min-width: 14rem; padding: .35rem 0; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 18px rgba(18, 35, 30, .14); }
.account-menu a, .account-menu .menu-button { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .55rem 1rem; color: var(--ink); text-decoration: none;
  font: inherit; font-weight: 400; background: none; border: 0; border-radius: 0; min-height: 44px; justify-content: flex-start; cursor: pointer; }
.account-menu a:hover, .account-menu .menu-button:hover { background: var(--csa-green-light); color: var(--csa-green-dark); }
.account-menu li + li:last-child { border-top: 1px solid var(--line); margin-top: .25rem; padding-top: .25rem; }
@media (max-width: 640px) {
  .account-name { max-width: 7rem; }
  /* The header wraps on phones: open the account menu across the header, wherever the name landed. */
  .header-inner { position: relative; }
  .account-menu { position: static; }
  .account-menu > ul { left: 1rem; right: 1rem; top: auto; min-width: 0; margin-top: .25rem; }
  .help-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Layout */
main { max-width: 70rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding-bottom: .75rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.lede { color: var(--muted); margin: 0; }
.grid { display: grid; gap: 1.5rem; }
.grid > * { min-width: 0; }  /* a column may shrink below its widest control (selects size to content) */
fieldset { min-width: 0; }  /* a fieldset otherwise refuses to shrink below its widest control */
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-main { grid-template-columns: 2fr 1fr; } }
.section { padding: .25rem 0 1rem; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.panel { background: var(--white); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: 0 1px 2px rgba(18, 58, 40, .08); }
.stat { font-family: var(--serif); font-size: 2rem; color: var(--csa-green); line-height: 1; }
.stat-label { color: var(--muted); font-size: .88rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.stack > * + * { margin-top: .75rem; }

/* Lists and tables */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .75rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.list > li:last-child { border-bottom: 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
@media (max-width: 640px) {
  table.responsive thead { display: none; }
  table.responsive tr { display: block; padding: .6rem 0; border-bottom: 1px solid var(--line); }
  table.responsive td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .2rem 0; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; }
  table.responsive td > .cell { text-align: right; }
}

/* Status pills */
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; background: var(--csa-green-light); color: var(--csa-green-dark); white-space: nowrap; }
.pill.gold { background: var(--csa-gold-light); color: #5a4a0c; }
.pill.red { background: var(--danger-light); color: var(--danger); }
.pill.grey { background: #eceeed; color: var(--muted); }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.msg { padding: .7rem .9rem; border-left: 4px solid var(--csa-green); background: var(--white); margin-bottom: .5rem; border-radius: 0 var(--radius) var(--radius) 0; }
.msg.error { border-color: var(--danger); background: var(--danger-light); }
.msg.warning { border-color: var(--csa-gold); background: var(--csa-gold-light); }
.notice { padding: .7rem .9rem; background: var(--csa-gold-light); border-radius: var(--radius); font-size: .92rem; }
.notice.synthetic { border: 1px dashed #a08a2e; }
.notice.restricted { background: var(--danger-light); border-left: 4px solid var(--danger); margin-bottom: 1rem; }
.empty { color: var(--muted); padding: 1rem 0; font-style: italic; }

/* Forms */
form.stacked p, form.stacked .field { margin: 0 0 1rem; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type=text], input[type=search], input[type=tel], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  height: var(--control-h); max-width: 100%; padding: 0 .6rem; border: 1px solid #b9c4be; border-radius: var(--radius);
  font: inherit; font-size: var(--control-font); line-height: 1.25; background: var(--white); color: inherit; }
/* Only free text gets a width; a select sizes to its longest option and a date or time to its format. */
input[type=text], input[type=search], input[type=tel], input[type=email], input[type=password], input[type=url] { width: 100%; max-width: 30rem; }
input[type=number] { width: 9rem; }
select { max-width: min(100%, 26rem); }  /* a very long option (some eparchy names) must not stretch the form */
textarea { width: 100%; max-width: 44rem; height: auto; min-height: 5.5rem; padding: .5rem .6rem; line-height: 1.45; }
select[multiple] { height: auto; padding: .3rem; }
input[type=file] { max-width: 100%; font: inherit; font-size: var(--control-font); }
input[type=checkbox] { width: 1.15rem; height: 1.15rem; vertical-align: middle; margin-right: .4rem; }
.helptext, .form-help { display: block; color: var(--muted); font-size: .85rem; font-weight: normal; margin-top: .2rem; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: .25rem 0; font-size: .9rem; }
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: var(--control-h); padding: 0 1rem; border-radius: var(--radius); border: 1px solid var(--csa-green); background: var(--csa-green); color: var(--white); font: inherit; font-size: var(--control-font); line-height: 1.25; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover, button:hover { background: var(--csa-green-dark); color: var(--white); }
.btn.secondary, button.secondary { background: var(--white); color: var(--csa-green); }
.btn.secondary:hover, button.secondary:hover { background: var(--csa-green-light); color: var(--csa-green-dark); }
.btn.danger, button.danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
.btn.link, button.link { background: none; border: 0; color: var(--csa-green); padding: 0; min-height: 0; text-decoration: underline; font-weight: 600; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
/* A label and its control as one unit that never splits across lines: the label above (forms) or beside it
   (.inline, compact filter bars). A .form-row wraps whole units, with its action button as the row's last item so it
   follows the last field instead of taking a line of its own. */
.form-field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; max-width: 100%; }
.form-field > label { margin: 0; }
.form-field > select, .form-field > input[type=date], .form-field > input[type=time], .form-field > input[type=number],
.form-field > input[type=file] { align-self: flex-start; min-width: 0; }
.form-field.inline { flex-direction: row; align-items: center; gap: .45rem; }
.form-field.inline > label { font-size: .88rem; white-space: nowrap; }
.form-row .form-field > select { max-width: 18rem; }  /* in rem, not %: a row sizes its units before percentages
   apply, so a very long option would reserve its full width; the open list still shows full names */
.form-field.grow { flex: 1 1 14rem; max-width: 28rem; }  /* grows with the row, but the button stays right after it */
.form-field.grow > input, .form-field.grow > textarea { max-width: 28rem; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem 1rem; margin: .5rem 0 0; }
.form-row.compact { align-items: center; gap: .5rem 1.1rem; }
.form-row > .form-actions { display: flex; align-items: center; gap: .75rem; }
@media (max-width: 40rem) {  /* phones: compact bars become two columns, labels above; the button takes the next cell */
  .form-row.compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .form-row.compact > .form-field.inline { flex-direction: column; align-items: stretch; gap: .25rem; }
  .form-row.compact > .form-field.inline > select { align-self: stretch; width: 100%; max-width: none; }
  .form-row.compact > .form-actions { flex-wrap: wrap; }
}
.inline-form { display: inline; }
.progress { height: .55rem; background: var(--csa-green-light); border-radius: 999px; overflow: hidden; min-width: 8rem; }
.progress > span { display: block; height: 100%; background: var(--csa-green); }
.req-list li { align-items: flex-start; }
.req-chapter, .req-section { margin: .35rem 0; }
.req-chapter > summary { font-weight: 600; padding: .45rem 0; cursor: pointer; border-bottom: 1px solid var(--line, #e3ded3); }
.req-section { margin-left: 1rem; }
.req-section > summary { padding: .35rem 0; cursor: pointer; }
.req-tools { margin: .25rem 0; }
.private-flag { color: var(--danger); font-weight: 600; font-size: .8rem; }
footer.site-footer { max-width: 70rem; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.auth-card { max-width: 30rem; margin: 1rem auto; }
.chart { margin: 0 0 1.25rem; }
.chart-canvas { width: 100%; min-height: 120px; }
.mermaid { background: var(--white); padding: 1rem; border-radius: var(--radius); overflow-x: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Evaluation summaries */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin: 1rem 0; }
.stat { display: flex; flex-direction: column; gap: .15rem; padding: .75rem .9rem; border-left: 4px solid var(--csa-green, #1f533b); background: var(--white, #fff); }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--csa-green, #1f533b); }
.stat-label { font-size: .9rem; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.chart-card h3 { margin: .25rem 0 .5rem; }
.chart-with-table { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
@media (max-width: 800px) { .chart-with-table { grid-template-columns: 1fr; } }
table.compact td, table.compact th { padding: .3rem .5rem; font-size: .9rem; }
details.numbers > summary { cursor: pointer; font-size: .9rem; color: var(--muted, #5c6b63); margin: .25rem 0; }
.scope-key { display: flex; flex-wrap: wrap; gap: 1rem; position: sticky; top: 0; background: var(--bg, #f7f4ee); padding: .4rem 0; z-index: 2; }
.scope-key .swatch { display: inline-block; width: .9rem; height: .9rem; margin-right: .35rem; vertical-align: -2px; border-radius: 2px; }

/* Tabs (evaluation types, workspace sections): plain underlined links, keyboard reachable. */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; border-bottom: 1px solid var(--line); margin: 0 0 1rem; }
.tabs a { padding: .5rem 0; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover, .tabs a:focus-visible { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--csa-gold); }
fieldset.choices { border: 0; padding: 0; margin: 0; }
fieldset.choices legend { font-weight: 600; margin-bottom: .25rem; padding: 0; }
fieldset.choices label { display: flex; gap: .5rem; align-items: baseline; font-weight: normal; margin: .2rem 0; }

/* Unit directory: compact filter grid and pager (thousands of units per diocese). */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .5rem .75rem; align-items: end; margin: 0 0 .75rem; }
.filters .filter-q { grid-column: 1 / -1; }
.filters label { display: block; font-size: .85rem; color: var(--muted); }
.filters input[type=search], .filters input[type=text] { width: 100%; }
.filters .filter-go { display: flex; gap: .75rem; align-items: center; }
.kind-strip { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0 0 .75rem; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; padding: 1rem 0; }
/* Label column wraps at 45% so a long question never pushes the answers off screen; phones stack them. */
dl.facts { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: .35rem 1rem; margin: 0 0 1rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
@media (max-width: 640px) {
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.facts dt { margin-top: .6rem; font-size: .88rem; }
}
/* Long unbroken tokens (digests, identifiers, email addresses, links) wrap instead of widening the page. */
code, dl.facts dd, td a, .mail-body { overflow-wrap: anywhere; }
.mail-body { white-space: pre-line; }

/* Annual report: section list beside a long form; two-column questions on wide screens. */
.report-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 64rem) { .report-layout { grid-template-columns: 13rem 1fr; } .report-toc { position: sticky; top: 1rem; align-self: start; } }
.report-toc ol { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
@media (max-width: 63.99rem) { .report-toc ol { flex-direction: row; flex-wrap: wrap; gap: .3rem 1rem; list-style: none; padding: 0; } }
.question-grid { display: grid; grid-template-columns: 1fr; gap: .25rem 1.25rem; }
@media (min-width: 48rem) { .question-grid { grid-template-columns: 1fr 1fr; } .question-grid .wide, .question-grid .group { grid-column: 1 / -1; } }
.question-grid .field input[type=text], .question-grid .field input[type=email], .question-grid .field input[type=url],
.question-grid .field textarea { width: 100%; }
fieldset.group { border: 0; border-top: 1px solid var(--line); padding: .5rem 0; margin: 0; }
fieldset.group legend { font-weight: 600; }
.group-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .25rem .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.sticky-save { position: sticky; bottom: 0; background: var(--cream); padding: .5rem 0; margin: 0; }
label.check { display: flex; gap: .5rem; align-items: baseline; font-weight: normal; }
details.filter-panel { margin: 0 0 .75rem; }
details.filter-panel > summary { cursor: pointer; font-weight: 600; padding: .35rem 0; }
.search-row { display: flex; gap: .5rem; align-items: end; margin: 0 0 .5rem; }
.search-row > div { flex: 1; min-width: 0; }
.dir-event { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.dir-event h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.dir-event p { margin: .15rem 0; }
.dir-event-when { font-weight: 600; }
.dir-event.featured { border: 0; border-left: 4px solid var(--csa-gold); background: var(--csa-gold-light); padding: .9rem 1rem; margin: 0 0 .75rem; border-radius: var(--radius); }
.dir-event.featured h3 { font-size: 1.25rem; }
.event-form input[type=datetime-local] { max-width: 18rem; }
.event-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; margin: 1rem 0; }
.search-row label { display: block; font-size: .85rem; color: var(--muted); }
.search-row input { width: 100%; }

/* Free-response answers: Trix editor with a compact format bar in the Spectrum 2 style used by ROAST (quiet 32px
   action buttons, 18px icons, 8px corners, thin dividers between groups), and the spelling and grammar check. */
main trix-toolbar { max-width: 44rem; }
main trix-toolbar .trix-button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .125rem .25rem;
  min-height: 2.5rem; padding: .25rem .375rem; overflow: visible; background: var(--white); border: 1px solid #c9d1cc;
  border-bottom: 0; border-radius: 8px 8px 0 0; }
main trix-toolbar .trix-button-group { display: flex; gap: .125rem; margin: 0; border: 0; border-radius: 0; }
main trix-toolbar .trix-button-group + .trix-button-group { padding-left: .375rem; margin-left: .125rem;
  border-left: 1px solid #dde3df; }
main trix-toolbar .trix-button-group-spacer { flex: 1 1 auto; }
main trix-toolbar .trix-button-group--history-tools { border-left: 0; }
main trix-toolbar .trix-button { position: relative; width: 2rem; height: 2rem; min-width: 2rem; min-height: 2rem;
  max-width: none; padding: 0; margin: 0; border: 0; border-radius: 8px; background: transparent; color: #292929;
  font-size: .875rem; }
main trix-toolbar .trix-button + .trix-button { border-left: 0; }  /* no lines between quiet buttons */
main trix-toolbar .trix-button--icon::before { inset: 0; background-size: 1.125rem 1.125rem; background-position: center;
  opacity: .78; }
main trix-toolbar .trix-button:hover:not(:disabled) { background: #eceeed; }
main trix-toolbar .trix-button:hover:not(:disabled)::before { opacity: 1; }
main trix-toolbar .trix-button.trix-active { background: var(--csa-green-light); }
main trix-toolbar .trix-button.trix-active::before { opacity: 1; }
main trix-toolbar .trix-button:disabled::before { opacity: .3; }
main trix-toolbar .trix-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
main trix-editor.prose-editor { display: block; max-width: 44rem; min-height: 5.5rem; padding: .55rem .65rem;
  background: var(--white); border: 1px solid #c9d1cc; border-radius: 0 0 8px 8px; }
main trix-editor.prose-editor:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.report-layout > *, .question-grid > * { min-width: 0; }  /* a wide toolbar must not stretch the grid on phones */
.writing-check { display: flex; flex-wrap: wrap; gap: .375rem; align-items: center; margin: .375rem 0 0; max-width: 44rem; }
.writing-check select.writing-language, .question-grid .field select.writing-language { width: auto; min-height: 2rem;
  padding: .2rem .5rem; font-size: .875rem; }
button.small, .btn.small { min-height: 2rem; padding: .2rem .75rem; font-size: .875rem; border-radius: 8px; }
.writing-results { flex-basis: 100%; font-size: .92rem; }
.writing-results > p { margin: .25rem 0; }
.writing-issues { list-style: none; margin: 0; padding: 0; }
.writing-issues li { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.writing-issues li p { flex-basis: 100%; margin: 0; }
.writing-issues mark { background: var(--csa-gold-light); padding: 0 .15rem; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: .25rem 0; padding-left: 1.25rem; }
.comment + .comment { border-top: 1px solid var(--line); padding-top: .4rem; margin-top: .4rem; }

/* Group meetings and the facilitator's progress report. */
.meetings > li { align-items: flex-start; }
.upcoming-meetings { margin: .5rem 0 1rem; }
.upcoming-meetings ul.small { margin: .2rem 0 .4rem; padding-left: 1.1rem; }
.table-scroll { overflow-x: auto; max-width: 100%; position: relative; }  /* contains visually hidden header text */
.table-scroll:focus-visible { outline: 3px solid var(--focus); }
.progress-matrix th, .progress-matrix td { text-align: center; padding: .35rem .45rem; white-space: nowrap; }
.progress-matrix th[scope="row"] { text-align: left; }
.progress-matrix .cell-complete { background: var(--csa-green-light); }
.progress-matrix .cell-in_progress { background: var(--csa-gold-light); }
.meeting-form fieldset.choices label { font-weight: normal; }

/* Yes / No as two radio buttons, never a drop-down. */
fieldset.yes-no { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.yes-no legend { font-weight: 600; margin-bottom: .25rem; padding: 0; }
.yes-no label.check, ul.yes-no label, div.yes-no label { display: inline-flex; align-items: center; gap: .4rem;
  margin: 0 1.25rem 0 0; min-height: 2rem; font-weight: normal; }
.yes-no input[type=radio] { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--csa-green); }
ul.yes-no, div.yes-no { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
span.label { display: block; font-weight: 600; margin-bottom: .25rem; }

/* Scheduling polls. */
fieldset.poll-options { min-width: 0; }  /* a fieldset otherwise grows to its widest content */
.poll-option-table input { min-width: 8rem; }
@media (max-width: 640px) {  /* each proposed time as a small block: date, then start and end side by side */
  .poll-option-table thead { display: none; }
  .poll-option-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .5rem; padding: .5rem 0;
    border-bottom: 1px dashed var(--line); }
  .poll-option-table td { display: block; border: 0; padding: 0; }
  .poll-option-table td:first-child { grid-column: 1 / -1; }
  .poll-option-table td::before { content: attr(data-label); display: block; font-size: .85rem; color: var(--muted); }
  .poll-option-table input { min-width: 0; width: 100%; }
}
.poll-answer { padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.poll-results th, .poll-results td { text-align: center; white-space: nowrap; }
.poll-results th[scope="row"] { text-align: left; white-space: normal; }
@media (max-width: 640px) {
  .poll-results { font-size: .85rem; }
  .poll-results th, .poll-results td { padding: .35rem .3rem; }
  .poll-results th[scope="row"] .pill { display: table; margin-top: .2rem; }
}
.poll-results tr.best { background: var(--csa-green-light); }
.poll-results .answer-yes { background: var(--csa-green-light); }
.poll-results .answer-maybe { background: var(--csa-gold-light); }

/* Evaluation filters: year, region, diocese. */

/* Public diocesan directory: type, whitespace and thin rules rather than boxes. */
.dir-hero { padding: .25rem 0 1rem; }
.dir-hero h1 { font-size: 2rem; }
.dir-kicker { color: var(--muted); font-size: .9rem; margin: 0 0 .2rem; }
.dir-crumbs { font-size: .85rem; color: var(--muted); margin: .25rem 0 .5rem; }
.dir-totals { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; padding: 0; margin: .75rem 0 0; color: var(--muted); }
.dir-totals strong { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; color: var(--csa-green); margin-right: .3rem; }
.dir-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, .8fr); gap: .75rem 1rem; align-items: end; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.dir-field label, .dir-choice legend { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .25rem; padding: 0; }
.dir-field input, .dir-field select { width: 100%; }
.dir-choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.dir-choice label { display: inline-block; position: relative; padding: .35rem .8rem; margin: 0 -1px 0 0; border: 1px solid var(--line); background: var(--white); font-size: .9rem; cursor: pointer; }
.dir-choice label:first-of-type { border-radius: var(--radius) 0 0 var(--radius); }
.dir-choice label:last-of-type { border-radius: 0 var(--radius) var(--radius) 0; }
.dir-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dir-choice label:has(input:checked) { background: var(--csa-green); border-color: var(--csa-green); color: var(--white); z-index: 1; }
.dir-choice label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; z-index: 2; }
.dir-buttons { display: flex; align-items: center; gap: 1rem; }
.dir-map { margin: 0 0 1.25rem; }
.dir-map .chart-canvas { width: 100%; aspect-ratio: 8 / 5; max-height: min(70vh, 30rem); }
.dir-detail .dir-map .chart-canvas { aspect-ratio: 5 / 4; }
.dir-count { font-size: .85rem; color: var(--muted); margin: 0; }
.dir-region { margin-top: 1.75rem; }
.dir-region-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem 1rem; padding-bottom: .3rem; border-bottom: 2px solid var(--csa-gold); }
.dir-region-head h2 { margin: 0; }
.dir-region-head h2 a { text-decoration: none; }
.dir-region-head h2 a:hover { text-decoration: underline; }
.dir-region-head p { margin: 0; font-size: .9rem; }
.dir-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); column-gap: 2.25rem; }
.dir-entry { padding: .75rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.dir-entry-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .1rem .75rem; }
.dir-name { font-weight: 600; text-decoration: none; }
.dir-name:hover { text-decoration: underline; }
.dir-meta { margin: .15rem 0 0; font-size: .85rem; color: var(--muted); }
.dir-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.dir-status::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: #aab6af; }
.dir-status.on { color: var(--csa-green-dark); font-weight: 600; }
.dir-status.on::before { background: var(--csa-green); }
.dir-status.big { font-size: .95rem; }
.dir-status.big::before { width: .7rem; height: .7rem; }
.dir-contacts { list-style: none; padding: 0; margin: .35rem 0 0; font-size: .88rem; }
.dir-contacts li { margin: .15rem 0; overflow-wrap: anywhere; }
.dir-contacts.big { font-size: 1rem; }
.dir-contacts.big li { margin: 0 0 .75rem; }
.dir-role { color: var(--muted); margin-right: .25rem; }
.dir-contacts.big .dir-role { display: block; font-size: .85rem; margin: 0; }
.dir-detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2.25rem; margin-bottom: 1.25rem; }
.dir-detail-main h2:first-child { margin-top: 0; }
.dir-detail ul.plain { list-style: none; padding: 0; margin: 0; }
.dir-detail ul.plain li { margin: .25rem 0; overflow-wrap: anywhere; }
@media (max-width: 800px) {
  .dir-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dir-search { grid-column: 1 / -1; }
  .dir-detail { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}
@media (max-width: 480px) {
  .dir-filters { grid-template-columns: minmax(0, 1fr); }
  .dir-hero h1 { font-size: 1.6rem; }
}

/* Forms (questionnaire versions): a draft's sections and questions, with editing tools beside each. */
.qv-plain { list-style: none; padding: 0; margin: 0 0 1rem; }
.qv-plain li { padding: .35rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.qv-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.qv-section-head h2 { margin: 1.25rem 0 .25rem; }
.qv-items { padding-left: 1.4rem; margin: .25rem 0 .75rem; }
.qv-items > li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.qv-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .4rem 1rem; }
.qv-item-text { flex: 1 1 22rem; min-width: 0; }
.qv-label { display: block; font-weight: 600; overflow-wrap: anywhere; }
.qv-meta, .qv-help { display: block; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.qv-help { font-style: italic; }
.qv-tools { display: flex; flex-wrap: wrap; gap: .35rem; margin-left: auto; }
.qv-actions form + form { margin-top: .75rem; }
.qv-form .check-field label { font-weight: 600; }
.qv-preview { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Report tables (emblems earned): right-aligned figures, growth in words and colour. */
table.numbers { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.numbers th, table.numbers td { padding: .4rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.numbers thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.numbers .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.numbers tfoot th, table.numbers tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }
.up { color: var(--csa-green); font-weight: 600; }
.down { color: var(--danger); font-weight: 600; }

table.numbers tbody th, table.numbers tfoot th { text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--ink); font-weight: 600; }
.dir-map .report-map { aspect-ratio: auto; max-height: none; min-height: 200px; }  /* Plot sizes the SVG itself */
.report-map svg, #report-trend svg { max-width: 100%; height: auto; }

/* Payment policy amounts: a compact table of number inputs. */
.policy-amounts { border: 0; padding: 0; margin: 1rem 0; min-width: 0; }
.policy-amounts legend { font-weight: 600; font-size: 1.05rem; margin-bottom: .5rem; padding: 0; }
.policy-amounts input[type=number] { max-width: 8rem; min-height: 40px; }

/* Unit award attachments. */
.attachment-list { padding-left: 1.2rem; }
.attachment-list li { margin: .3rem 0; overflow-wrap: anywhere; }
.attachment-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: .75rem; }
.attachment-grid img { width: 100%; height: 9rem; object-fit: cover; border-radius: var(--radius); display: block; }
.attachment-doc { display: flex; align-items: center; min-height: 9rem; padding: .75rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow-wrap: anywhere; }
@media (pointer: coarse) {  /* compact selects elsewhere still need 16px on touch screens (iOS zooms otherwise) */
  .writing-check select.writing-language, .question-grid .field select.writing-language { font-size: 16px; }
}
.key-picks { padding-left: 1.2rem; }
.key-picks li { margin: 0 0 .7rem; }
.new-device { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin: 1rem 0; }
.new-device img { background: var(--white); padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius); }
.setup-key { font-size: 1rem; letter-spacing: .08em; overflow-wrap: anywhere; }
ol.steps li { margin: 0 0 .4rem; }
.waiting-count { font-weight: 700; font-size: 1.1rem; min-width: 2ch; text-align: right; }
.narrow { max-width: 34rem; }

/* Question kinds (templates/questionnaires/_question.html; questions.js runs the conditions, rows and pages). */
.q-off { display: none !important; }
.req { color: var(--danger); font-weight: 700; }
.q-set { border: 0; padding: 0; margin: 0; min-width: 0; }
.q-set > legend { font-weight: 600; margin-bottom: .25rem; padding: 0; }
.affix { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; }
.affix-text { color: var(--muted); font-weight: 600; }
.spinner button { min-width: var(--control-h); padding: 0; font-size: 1.2rem; }
.spinner input[type=number] { width: 6.5rem; text-align: center; }
.choices { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.choices label.check { font-weight: normal; align-items: center; min-height: var(--control-h); margin: 0; }
.choices.cols-1 { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 36rem) { .choices.cols-2, .choices.cols-3, .choices.cols-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 48rem) { .choices.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choices.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.choices.cards label.check { padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.choices.cards label.check:has(input:checked) { border-color: var(--csa-green); background: var(--csa-green-light); }
.choices input[type=radio], .choices input[type=checkbox], .rs-options input[type=radio] { accent-color: var(--csa-green); }
.lookup-list { max-height: 18rem; overflow-y: auto; }
.q-other { display: block; margin-top: .35rem; }
label.toggle input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 2.6rem; height: 1.5rem; flex: none;
  border-radius: 1rem; background: #b9c4be; position: relative; cursor: pointer; margin: 0 .5rem 0 0; transition: background .15s; }
label.toggle input[type=checkbox]::before { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1.2rem;
  height: 1.2rem; border-radius: 50%; background: var(--white); transition: transform .15s; }
label.toggle input[type=checkbox]:checked { background: var(--csa-green); }
label.toggle input[type=checkbox]:checked::before { transform: translateX(1.1rem); }
label.toggle { align-items: center; }
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .25rem .75rem; max-width: 44rem; }
.parts > * { min-width: 0; }
.parts .part-line1, .parts .part-line2 { grid-column: 1 / -1; }
.parts label { font-weight: normal; }
.parts input[type=text] { max-width: none; }
.rating-scale .rs-row { border: 0; border-bottom: 1px dashed var(--line); padding: .35rem 0; margin: 0; min-width: 0; }
.rating-scale .rs-row legend { padding: 0; font-weight: normal; }
.rs-options { display: flex; flex-wrap: wrap; gap: 0 1.1rem; }
.rs-options label.check { font-weight: normal; align-items: center; min-height: var(--control-h); margin: 0; }
.signature { max-width: 34rem; }
.sig-canvas { display: block; width: 100%; height: 10rem; border: 1px solid #b9c4be; border-radius: var(--radius);
  background: var(--white); touch-action: none; cursor: crosshair; }
.sig-tools { margin: .25rem 0 .5rem; }
.signature-img { display: block; max-width: 16rem; max-height: 6rem; background: var(--white); border-bottom: 1px solid var(--ink); }
.signature-typed { display: inline-block; font-family: "Segoe Script", "Brush Script MT", "Apple Chancery", cursive;
  font-size: 1.6rem; border-bottom: 1px solid var(--ink); padding: 0 .5rem; }
.q-output { display: block; font-weight: 700; font-size: 1.1rem; padding: .35rem 0; }
.q-content p { margin: .3rem 0; }
.q-content { max-width: 44rem; }
.group-row-label { font-weight: 600; margin: .25rem 0 0; grid-column: 1 / -1; }
.group-row .row-remove { justify-self: start; align-self: end; margin-bottom: .6rem; }
.group-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: .5rem 0; }
.group-summaries span { margin-right: 1.25rem; display: inline-block; }
.group-table .table-head { display: none; }
@media (min-width: 48rem) {
  .group-table .table-head, .group-table .group-row { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)) 5rem;
    gap: .25rem .75rem; align-items: start; }
  .group-table .table-head span { font-weight: 600; font-size: .9rem; }
  .group-table .group-row .field > label, .group-table .group-row .q-set > legend { position: absolute !important;
    width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .group-table .group-row { padding: .25rem 0; }
  .group-table .group-row .field input[type=text], .group-table .group-row .field input[type=email],
  .group-table .group-row .field input[type=url], .group-table .group-row .field input[type=tel] { max-width: none; }
}
.q-pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin: 1rem 0; }
.qv-block { border: 0; border-top: 1px solid var(--line); padding: .75rem 0 .25rem; margin: 0 0 .5rem; min-width: 0; }
.qv-block > legend { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--csa-green-dark); padding: 0 .25rem 0 0; }
.qv-rule-rows { list-style: none; padding: 0; margin: .25rem 0; }
.qv-rule-row { align-items: end; }
.qv-condition { padding-left: .75rem; border-left: 3px solid var(--csa-green-light); margin: .25rem 0 .5rem; }
.qv-error { margin-bottom: .75rem; }
.qv-column { padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.qv-column-options { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-items: center; }
.qv-badges { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
/* Reviews: what to work on, and grouping by type or person */
.review-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin: 0 0 1rem;
  padding: .5rem 0; border-bottom: 1px solid var(--line); }
.review-filter-label { margin: 0; font-weight: 600; }
.pills-nav { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.pills-nav a { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--control-h); padding: 0 .85rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white); text-decoration: none; color: var(--ink); }
.pills-nav a:hover { border-color: var(--csa-green); }
.pills-nav a[aria-current] { background: var(--csa-green); border-color: var(--csa-green); color: var(--white); }
.pills-nav .count { font-weight: 700; }
.review-group { margin: 0; }
.review-group a[aria-current] { font-weight: 700; color: var(--ink); text-decoration: none; }
.review-type { margin: 0 0 .15rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
