/* Admin (accounts) pages – extends style.css */
body.admin .site-nav { align-items: center; }
body.admin main { padding-top: 2rem; }
.mt { margin-top: 2rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.tab > h1 { margin-bottom: .75rem; }
.tab section + section { margin-top: 0; }
.wide-form { max-width: 820px; margin-top: 2.5rem; }
.wide-form .table-scroll { margin-bottom: .5rem; }
.rates input { width: 6.5rem; font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); text-align: right; }
.rates th, .rates td { white-space: nowrap; }
.pay-info { margin: 0; min-height: 1.4em; font-size: .95rem; }
.pay-info strong { color: var(--ink); }
.status-pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .05rem .45rem; border-radius: 4px; background: var(--paper); color: var(--muted); }
.status-pill.cancelled { background: #FBE4E4; color: #9A2B2B; }
dialog { width: min(920px, 100% - 1.5rem); max-height: 92vh; border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(10, 20, 30, .45); }
dialog .form { max-width: none; }
fieldset.charges { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 1rem; }
fieldset.charges legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
#unit-charges { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
#unit-charges label { font-weight: 500; font-size: .88rem; }
.notice-admin { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.notice-admin p { margin: 0; }
textarea { font: inherit; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.committee-row { display: grid; grid-template-columns: 9rem 1.4fr .8fr 1fr auto; gap: .75rem; align-items: end; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.committee-actions { display: flex; gap: .35rem; padding-bottom: .2rem; }
@media (max-width: 860px) { .committee-row { grid-template-columns: 1fr 1fr; } .committee-actions { grid-column: 1 / -1; } }
@media (max-width: 560px) { .committee-row { grid-template-columns: 1fr; } }
.progress-ok { color: var(--credit); font-weight: 600; }
.entry-form label { min-width: 0; }
.entry-form input, .entry-form select { width: 100%; min-width: 0; }
.entry-form #pay-info { grid-column: 1 / -1; }
.inline-label input { font: inherit; font-weight: 400; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.receipt.sheet { min-height: 0; }
#billing-form { max-width: none; }
#billing-form > label { max-width: 460px; }
#society-fields, #committee-fields { display: grid; gap: 1rem; }
#unit-charges label { min-width: 0; align-content: end; }
#unit-charges input { width: 100%; min-width: 0; }
dialog h3 { margin-top: 1.5rem; }
.rates input.cat-name { width: 22rem; text-align: left; }
.small { font-size: .88rem; margin: -.5rem 0 0; }
#billing-form h3 { margin: 1.25rem 0 0; }
#billing-form > label.wide-label { max-width: 820px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; }
.field-row label { min-width: 0; }
.field-row input { width: 100%; min-width: 0; }
.rates input.exp-name { width: 24rem; text-align: left; }
.rates select { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); }
#mmc-form > label { max-width: 560px; }
#mmc-form h3 { margin: 1.5rem 0 0; }
#mmc-summary dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.5rem; margin: 0; }
#mmc-summary dt { color: var(--muted); }
#mmc-summary dd { margin: 0; font-weight: 600; }
.warn { color: var(--warn-ink); background: var(--warn-bg); padding: .1rem .4rem; border-radius: 4px; }
#mmc-preview-box table td, #mmc-preview-box table th { white-space: nowrap; }
#mmc-preview-box { max-width: none; }
.btn-google { gap: .6rem; width: 100%; max-width: 460px; }
.g-logo { font-weight: 800; color: #4285F4; font-size: 1.1rem; }
.or-line { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .9rem; max-width: 460px; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.small-note { font-size: .88rem; margin: 0; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .5rem 1rem; }
.perm-grid label { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; font-size: .92rem; }
.perm-grid input { margin-top: .25rem; width: auto; }
.entry-form .wide-all { grid-column: 1 / -1; }
.agreement { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; max-width: 820px; margin-bottom: 1.5rem; }
.agreement h1 { font-size: 1.5rem; }
.agreement h2 { font-size: 1.1rem; margin-top: 1.5rem; }
.agreement ol { padding-left: 1.25rem; }
.agreement li { margin-bottom: .45rem; max-width: 72ch; }
.agreement .meta-line { color: var(--muted); font-size: .9rem; }
.agreement table { margin: .5rem 0 1rem; }
.pill-ok { color: var(--credit); font-weight: 600; }
.pill-no { color: var(--muted); }
@media print {
  body.admin .site-header, #agreement-form .form-actions, #agreement-form .form-msg { display: none !important; }
  .agreement { border: 0; padding: 0; }
}
.entry-form .perm-grid input, .perm-grid input[type=checkbox] { width: 1rem; height: 1rem; min-width: 1rem; flex: none; }
#measure-rows td.i2 { font-size: .82rem; color: var(--muted); white-space: normal; min-width: 16rem; }
#measure-rows select.src { font-size: .85rem; }
#measure-rows tr.filled td { background: var(--stamp-soft); }
.area-warn { color: var(--warn-ink); }

/* ---- Measurement grid: fits the screen, one unit per block ---- */
body.admin .wrap { width: min(1320px, 100% - 2rem); }
.grid-tools { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin: 1rem 0 .75rem; }
.grid-tools .search { flex: 0 1 320px; }
table.measure { font-size: .95rem; }
table.measure th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
table.measure td { vertical-align: middle; padding: .55rem .6rem; }
table.measure tr.m-row td { border-bottom: 0; }
table.measure tr.m-note td { padding: 0 .6rem .7rem; font-size: .84rem; color: var(--muted); border-bottom: 1px solid var(--line); }
table.measure tr.m-note:hover, table.measure tr.m-row:hover { background: transparent; }
table.measure td.who strong { display: block; font-size: 1rem; }
table.measure td.who span { display: block; color: var(--muted); font-size: .88rem; max-width: 22rem; }
table.measure input { width: 6rem; font: inherit; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); text-align: right; }
table.measure td[data-label="Carpet area (sq ft)"] input { width: 7rem; font-weight: 600; }
table.measure select { font: inherit; padding: .4rem .45rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); max-width: 13rem; }
table.measure input::-webkit-outer-spin-button, table.measure input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
table.measure input[type=number] { -moz-appearance: textfield; }
table.measure tr.filled td, table.measure tr.filled + tr.m-note td { background: var(--stamp-soft); }

/* Phones and narrow windows: each unit becomes a card with labelled fields */
@media (max-width: 900px) {
  table.measure thead { display: none; }
  table.measure, table.measure tbody { display: block; }
  table.measure tr.m-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .9rem; padding: .9rem .9rem .3rem; border-top: 1px solid var(--line); }
  table.measure tr.m-row td { display: grid; gap: .2rem; padding: 0; }
  table.measure tr.m-row td.who { grid-column: 1 / -1; }
  table.measure tr.m-row td[data-label]::before { content: attr(data-label); font-size: .78rem; font-weight: 600; color: var(--muted); }
  table.measure tr.m-row td.num { text-align: left; }
  table.measure input, table.measure td[data-label="Carpet area (sq ft)"] input, table.measure select { width: 100%; max-width: none; text-align: left; }
  table.measure tr.m-note { display: block; }
  table.measure tr.m-note td { display: block; padding: .3rem .9rem .9rem; }
}
.save-bar { position: sticky; bottom: 0; z-index: 3; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; margin-top: .75rem; box-shadow: 0 -4px 12px rgba(0,0,0,.06); display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.save-bar .form-msg { flex: 1 1 260px; }
.uf-tabs { margin: 1.25rem 0 .5rem; }
.uf-pane { margin-top: 1rem; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem 1rem; }
.rec-grid label { min-width: 0; }
.rec-grid input, .rec-grid select, .rec-grid textarea { width: 100%; min-width: 0; }
.rec-grid .full { grid-column: 1 / -1; }
.rec-grid h3 { grid-column: 1 / -1; margin: .75rem 0 0; font-size: 1rem; color: var(--muted); }
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .05rem .45rem; border-radius: 4px; background: var(--paper); }
.pill.ok { background: #E3F2E8; color: var(--credit); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.past { color: var(--muted); }
td .sub { display: block; color: var(--muted); font-size: .84rem; }
@media print {
  body.admin .tab:not([data-tab="unitfile"]), body.admin #no-units, .uf-tabs, .uf-pane .form-actions, #uf-pick, #uf-print, td:last-child button { display: none !important; }
  .uf-pane[hidden] { display: block !important; }
  body.admin .wrap { width: 100%; }
}
#rp-body table td, #rp-body table th { white-space: nowrap; }
#rp-body .num-big { font-size: 1.25rem; font-weight: 700; }
#rp-body h2 { margin-top: 1.5rem; }
.rp-print-head { display: none; }
@media print {
  body.admin .tab:not([data-tab="reports"]):not([data-tab="unitfile"]) { display: none !important; }
  #rp-tabs, #rp-fy, #rp-print, #rp-csv, #rp-body .form-actions { display: none !important; }
  .rp-print-head { display: block; }
}
.fy-line td { background: var(--paper); }
.actions-grid { display: grid; gap: .6rem; max-width: 860px; }

/* ---- audited statements ---- */
.stmt-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .stmt-pair { grid-template-columns: 1fr; } }
table.stmt td, table.stmt th { white-space: normal; }
table.stmt tr.grp td { font-weight: 600; background: var(--paper); }
table.stmt tr.item td:first-child { padding-left: 1.4rem; color: var(--ink-2, inherit); }
table.stmt tr.tot td { font-weight: 700; border-top: 2px solid var(--line); }
dl.facts.audit-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem 1.2rem; }
dl.facts.audit-facts dt { font-size: .8rem; color: var(--muted); }
dl.facts.audit-facts dd { margin: 0; font-weight: 600; }
dl.facts.audit-facts > div { display: block; padding: .6rem 0; border-bottom: 1px solid var(--line); }
dl.facts.audit-facts dt { margin-bottom: .15rem; }
dl.facts.audit-facts small { font-weight: 400; }
table.trend th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
table.trend td, table.trend th { padding-left: .5rem; padding-right: .5rem; }
.bar-cell { min-width: 6rem; width: 8rem; }
.bar { display: block; height: 10px; border-radius: 0 4px 4px 0; background: var(--stamp); min-width: 2px; }
.bar.cr { background: var(--credit, #2e7d4f); }
.src-tag { font-size: .75rem; color: var(--muted); }
table.prereg-table td { vertical-align: top; }
table.pr-table tr.not-counted td { color: var(--muted); }
table.pr-table tr.not-counted td.num { text-decoration: line-through; }
table.pr-table .flags { display: block; margin-top: .25rem; font-size: .8rem; color: var(--warn-ink); }
#pr-checks ul { margin: .25rem 0 .75rem; padding-left: 1.2rem; color: var(--warn-ink); font-size: .9rem; }
.pill.bad { background: #fde8e8; color: #9b1c1c; }
.warn-cell { background: var(--warn-bg); }
table.prereg-table td:last-child .btn { white-space: nowrap; }

/* ---------- Members: rejected list, sign-in history (3.4) ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin: .75rem 0; }
.filter-row label { display: grid; gap: .2rem; font-size: .88rem; font-weight: 600; }
.filter-row select { font: inherit; font-weight: 400; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.si-summary { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 .75rem; }
.si-summary span { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; font-size: .88rem; }
.si-summary b { font-variant-numeric: tabular-nums; }
.si-problem { border-left: 4px solid var(--due); background: #FBEFEF; padding: .6rem .8rem; margin: .5rem 0; border-radius: 0 var(--radius) var(--radius) 0; }
.si-problem p { margin: .2rem 0; }
.si-problem code { word-break: break-all; user-select: all; }
@media (prefers-color-scheme: dark) { .si-problem { background: #2A1C1E; } }
.status-pill.ok { background: #E3F1E8; color: #2B6A45; }
.status-pill.failed { background: #FBE4E4; color: #9A2B2B; }
.status-pill.closed { background: #FFF4D6; color: #6B4E00; }
.signin-table td { vertical-align: top; }
.signin-table .si-detail { font-size: .82rem; color: var(--muted); max-width: 26rem; word-break: break-word; }
.signin-table .si-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-list { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .4rem; font-size: .9rem; }
.history-list li { border-left: 3px solid var(--line); padding-left: .6rem; }
.history-list .muted { font-size: .82rem; }
/* 3.5: tell the member, relation pills, delete selection */
.notify-box { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.notify-box p { margin: 0; flex: 1 1 18rem; }
.notify-box .form-actions { margin: 0; }
.rel-pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .05rem .45rem; border-radius: 4px; background: var(--stamp-soft); color: var(--stamp); white-space: nowrap; }
.access-note { font-size: .85rem; color: var(--muted); }
.si-check { width: 2rem; }
/* 3.6: role policies, directory */
.role-policy { border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .8rem; margin: .4rem 0; background: var(--surface); }
.role-policy summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
.role-policy summary .muted { font-weight: 400; }
.role-policy .rp-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: end; margin: .5rem 0; }
.role-policy .rp-row input[type=number] { width: 6rem; }
.dir-table td { vertical-align: top; }
.dir-table ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.group-pill { display: inline-block; font-size: .75rem; padding: .05rem .4rem; border-radius: 4px; background: #FFF4D6; color: #6B4E00; margin-left: .3rem; }

/* ---------- Expenses (3.7) ---------- */
.exp-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--line); margin: .5rem 0 1rem; }
.exp-tabs button { font: inherit; background: none; border: 0; border-bottom: 3px solid transparent; padding: .55rem .8rem; cursor: pointer; color: var(--muted); }
.exp-tabs button[aria-selected="true"] { color: var(--stamp); border-bottom-color: var(--stamp); font-weight: 600; }
.form-row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.form-row > label { flex: 1 1 12rem; }
.paid-by { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem .7rem; display: grid; gap: .35rem; }
.paid-by legend { font-weight: 600; padding: 0 .3rem; }
.paid-by label.check { display: flex; align-items: flex-start; gap: .5rem; text-align: left; justify-content: flex-start; }
.entry-form .paid-by input[type=radio] { width: 1.05rem; height: 1.05rem; min-width: 1.05rem; flex: none; margin-top: .2rem; }
.exd-facts { display: block; margin: .5rem 0 1rem; }
.file-btn { display: inline-flex; cursor: pointer; }
.exp-files { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .5rem; }
.exp-files li { display: flex; align-items: center; gap: .75rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .6rem; background: var(--surface); }
.exp-files img, .exp-files .file-ico { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; flex: none; }
.exp-files .file-ico { display: grid; place-items: center; background: #FBE4E4; color: #9A2B2B; font-weight: 700; font-size: .8rem; }
.exp-files span { flex: 1; min-width: 0; word-break: break-word; font-size: .9rem; }
.wide-dialog { width: min(52rem, 96vw); }
.exd-facts > div { display: grid; grid-template-columns: 9rem 1fr; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.exd-facts dt { color: var(--muted); }
.exd-facts dd { margin: 0; }
.exd-files { display: flex; flex-wrap: wrap; gap: .75rem; }
.exd-files figure { margin: 0; width: 12rem; }
.exd-thumb { min-height: 6rem; border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center; font-size: .85rem; color: var(--muted); overflow: hidden; background: var(--paper); }
.exd-thumb img { display: block; width: 100%; height: auto; }
.exd-files figcaption { font-size: .75rem; color: var(--muted); word-break: break-word; margin-top: .25rem; }
.exs-items { display: grid; gap: .3rem; max-height: 14rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; font-size: .9rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--stamp); text-decoration: underline; cursor: pointer; font: inherit; }
.exp-report table { width: 100%; margin-bottom: 1rem; }
.exp-report tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
@media print {
  body.printing-report > *:not(main), body.printing-report main > *:not([data-tab=expenses]),
  body.printing-report [data-tab=expenses] > *:not(.exp-pane[data-pane=report]),
  body.printing-report #exr-actions { display: none !important; }
  body.printing-report .exp-pane[data-pane=report] { display: block !important; }
}
/* 3.8: bill sheets, recovery */
.items-table td { padding: .25rem; vertical-align: top; }
.items-table input, .items-table select { width: 100%; min-width: 6.5rem; font: inherit; padding: .35rem .4rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); }
.items-table td:nth-child(3) input { min-width: 11rem; }
.items-table td:nth-child(5) input { min-width: 5.5rem; text-align: right; }
.exd-sheet { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem .8rem; margin: .5rem 0 1rem; background: var(--paper); }
.exd-sheet h3 { margin: .2rem 0 .4rem; font-size: 1rem; }
.exd-sheet ul { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .3rem; font-size: .92rem; }
.exd-sheet li.current { font-weight: 600; }
.exd-lift { border: 1px dashed var(--stamp); border-radius: var(--radius); padding: .5rem .8rem .8rem; margin: 1rem 0; }
/* 3.11: duplicate receipts in the unit file */
.dup-table td:first-child, .dup-table th:first-child { width: 2.2rem; text-align: center; }
.dup-table input[type="checkbox"] { width: 1.15rem; height: 1.15rem; }
.dup-table tr.picked td { background: var(--stamp-soft); }
.dup-form { margin-top: 1rem; max-width: 760px; }
.dup-form .form-actions { align-items: center; gap: 1rem; }
/* 3.12: unit file scans, electricity and property tax */
.rec-files { min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1rem .8rem; margin: 1rem 0 0; }
.rec-files legend { font-weight: 600; padding: 0 .3rem; }
.rec-file-list { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .35rem; }
.rec-file-list li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.rec-file-list li.removing span { text-decoration: line-through; color: var(--muted); }
.rec-file-list .new { color: var(--credit); font-size: .85rem; }
.doc-chip { font: inherit; font-size: .84rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--stamp); padding: .15rem .6rem; cursor: pointer; margin: .1rem .2rem .1rem 0; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-chip:hover, .doc-chip:focus-visible { border-color: var(--stamp); }
.ufdoc-body { min-height: 6rem; display: grid; place-items: center; }
.ufdoc-body img { max-width: 100%; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius); }
.ut-flag { border-left: 4px solid var(--due); background: color-mix(in srgb, var(--due) 8%, var(--surface)); padding: .8rem 1rem; border-radius: var(--radius); margin: .5rem 0 1rem; }
.ut-flag h3 { margin: 0 0 .3rem; color: var(--due); font-size: 1rem; }
.ut-flag ul { margin: .3rem 0 .5rem; padding-left: 1.2rem; }
.ut-ok { color: var(--credit); margin: .3rem 0 1rem; }
.uf-backup-line { margin: .4rem 0 0; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.uf-backup-line .btn-link { padding: 0; font-size: inherit; }
.rec-files input[type="file"] { max-width: 100%; width: 100%; }
.rec-file-list li span { overflow-wrap: anywhere; }
/* 3.13: member portal agreement and member documents */
.ma-box summary { cursor: pointer; }
.ma-box[open] summary { margin-bottom: .6rem; }
.warn-note { border-left: 4px solid #b7791f; background: color-mix(in srgb, #b7791f 8%, var(--surface)); }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.45; }
.count-pill { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: var(--due); color: #fff; font-size: .75rem; line-height: 1.3rem; text-align: center; margin-left: .25rem; }
.ag-ok { color: var(--credit); font-weight: 600; }
.ag-no { color: var(--due); font-weight: 600; }
.ag-mail { display: block; font-size: .82rem; margin-top: .15rem; }
.ag-mail.ok { color: var(--credit); }
.ag-mail.no { color: var(--due); }
.ag-send { margin-top: .35rem; }
/* 3.14: correspondence register */
.cr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.cr-grid .wide { grid-column: 1 / -1; }
.cr-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cr-dir { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 4px; padding: 0 .35rem; margin-right: .3rem; }
.cr-dir.in { background: color-mix(in srgb, var(--credit) 14%, transparent); color: var(--credit); }
.cr-dir.out { background: color-mix(in srgb, var(--stamp) 14%, transparent); color: var(--stamp); }
.cr-overdue { color: var(--due); font-weight: 600; }
.cr-cards { margin: 1rem 0; }
/* 3.15: penal interest */
.ip-box { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1rem .8rem; }
.ip-table input { width: 100%; }
.ip-table td:nth-child(1) { width: 11rem; } .ip-table td:nth-child(2) { width: 7rem; }
.pi-box summary { cursor: pointer; }
.pi-table tr.pi-months td { background: var(--paper, #f6f7f9); font-size: .86rem; }
.pi-months table { width: auto; }

/* 3.16: reminders and invitations */
.rm-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.rm-tab { font: inherit; font-size: .9rem; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.rm-tab[aria-selected="true"] { background: var(--stamp); border-color: var(--stamp); color: #fff; }
@media (prefers-color-scheme: dark) { .rm-tab[aria-selected="true"] { color: #10162E; } }
.rm-tab .count { font-weight: 700; margin-left: .2rem; }
.rm-opts label.check { display: flex; flex-direction: row; align-items: center; gap: .45rem; font-weight: 400; align-self: end; }
.rm-template { margin: .5rem 0 .75rem; }
.rm-template summary { cursor: pointer; font-weight: 600; }
.rm-table td { vertical-align: top; }
.rm-table .sub { display: block; font-size: .82rem; color: var(--muted); }
.rm-send-cell { display: flex; flex-wrap: wrap; gap: .35rem; }
.rm-send-cell a { white-space: nowrap; }
.rm-contact { word-break: break-word; }
@media (max-width: 700px) {
  .rm-table { min-width: 0 !important; }
  .rm-table thead { display: none; }
  .rm-table, .rm-table tbody, .rm-table tr, .rm-table td { display: block; width: auto; }
  .rm-table tr { position: relative; padding: .65rem .75rem .65rem 2.6rem; border-bottom: 1px solid var(--line); }
  .rm-table td { padding: .1rem 0; border: 0; }
  .rm-table td:first-child { position: absolute; left: .8rem; top: .75rem; }
  .rm-table td.empty { padding: .5rem 0; }
  .rm-table td.unit { font-weight: 700; }
  .rm-table td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: .82rem; }
  .rm-table td[data-l] .sub { display: inline; margin-left: .3rem; }
  .rm-send-cell { margin-top: .4rem; }
  .rm-send-cell .btn { flex: 1; text-align: center; }
}
.si-who { color: var(--ink); }
.stray-table td:first-child .muted { white-space: nowrap; }

/* 3.18: applications to view the Society's accounts; member view permissions */
.ar-box h2 { margin-top: 0; }
.ar-box .count { font-weight: 700; }
.ar-grant { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin: 0 0 .75rem; display: grid; gap: .35rem; }
.ar-grant legend { font-weight: 600; padding: 0 .3rem; }
.ar-grant input[type="date"] { max-width: 12rem; }
.view-extra { display: block; font-size: .82rem; color: var(--credit); }
.ar-mail { display: block; font-size: .82rem; color: var(--muted); }
.tab.only-apps > :not(h1):not(#ar-box):not(dialog) { display: none !important; }

/* 3.19: Managing Committee, undertaking, M-20 bonds */
.mc-box { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 2rem; background: var(--surface); }
.mc-box h2 { margin-top: 0; }
.mc-box .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem 1rem; }
.mc-table td { vertical-align: top; }
.mc-table .sub, .mc-box .sub { display: block; font-size: .82rem; color: var(--muted); }
.m20-ok { color: var(--credit); font-weight: 600; }
.m20-due { color: var(--muted); font-weight: 600; }
.m20-late { color: var(--due); font-weight: 600; }
.mc-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
#committee-notice p { margin: .2rem 0; }

/* 3.20: library */
.lib-form .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem 1rem; }
.lib-source { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin: 0 0 .75rem; display: grid; gap: .4rem; }
.lib-source legend { font-weight: 600; padding: 0 .3rem; }
.lib-table td { vertical-align: top; }
.lib-table .sub { display: block; font-size: .82rem; color: var(--muted); }
.lib-removed { opacity: .6; }
.tab[data-tab="library"] .filter-row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; margin-bottom: .75rem; }
.tab[data-tab="library"] .filter-row label:not(.check) { display: grid; gap: .25rem; }
.tab[data-tab="library"] .filter-row input[type="search"] { min-width: min(24rem, 80vw); }
.tab[data-tab="library"] .filter-row label.check { display: flex; flex-direction: row; align-items: center; gap: .4rem; padding-bottom: .5rem; }

/* 3.22: pre-registered members */
.prereg-box .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .75rem 1rem; }
.prereg-table td { vertical-align: top; }
.prereg-table .sub { display: block; font-size: .82rem; color: var(--muted); }

/* 3.23: membership transfers */
.tab[data-tab="transfers"] .filter-row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; margin-bottom: .5rem; }
.tab[data-tab="transfers"] .filter-row label { display: grid; gap: .25rem; }
.tr-table td, .tr-items td { vertical-align: top; }
.tr-table .sub, .tr-items .sub { display: block; font-size: .82rem; color: var(--muted); }
.tr-bar { display: block; height: 6px; border-radius: 3px; background: var(--line); margin-top: .3rem; overflow: hidden; max-width: 9rem; }
.tr-bar i { display: block; height: 100%; background: var(--credit); }
.wide-dialog { width: min(68rem, 96vw); }
#tr-dialog .form-grid, #trc-lists .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem 1rem; }
.tr-items input[type="date"] { max-width: 10.5rem; }
.tr-items input[type="file"] { max-width: 13rem; font-size: .8rem; }
.trc-list { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin: .75rem 0; }
.trc-list table input, .trc-list table select { width: 100%; }

/* 3.24: bye-law forms */
fieldset.lib-guide { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; margin: .6rem 0; }
.lib-guide .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .5rem 1rem; }
.lib-guide-line, .tr-form-line { color: var(--ink-2, #444); }
#libset-box { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin: .8rem 0 1rem; }
#libset-box summary { cursor: pointer; font-weight: 600; }
.libset-table td { vertical-align: top; }
.libset-table .sub { display: block; font-size: .82rem; color: var(--muted); }

/* 3.25: full backups */
.fb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem 1rem; }
.fb-status { padding: .5rem .75rem; border-radius: 8px; background: var(--paper-2, #f6f4ee); }
.fb-status.bad { background: #fdecea; color: #8c1d18; }
.fb-status.ok { background: #e8f4ec; }
.fb-cols { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.fb-table td { vertical-align: top; }
#fb-dialog { width: min(40rem, 94vw); }

/* 3.26: website settings backup */
.sb-table td { vertical-align: top; }
.sb-table .sub { display: block; font-size: .82rem; color: var(--muted); }
.sb-st { font-size: .85rem; font-weight: 600; }
.sb-st.same { color: var(--muted); font-weight: 400; }
.sb-st.different, .sb-st.missing { color: #8a5300; }
.sb-st.skip, .sb-st.permanent, .sb-st.extra { color: var(--muted); }
#sb-box .file-btn { cursor: pointer; }

/* 3.28: library bulk actions, site offline, notices */
.lib-bulk { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem .8rem; padding: .5rem .7rem; border: 1px dashed var(--line); border-radius: 8px; margin: .5rem 0; font-size: .9rem; }
.lib-bulk label { display: grid; gap: .2rem; }
.lib-vis { font-size: .78rem; padding: .05rem .45rem; border-radius: 999px; border: 1px solid var(--line); background: none; cursor: pointer; }
.lib-vis.pub { background: #e8f4ec; border-color: #9cc9a9; }
.lib-vis.priv { background: #f3f0ea; }
#offline-banner { background: #8c1d18; color: #fff; text-align: center; padding: .45rem 1rem; font-weight: 600; }
#offline-banner a { color: #fff; }
.so-box.on { border-color: #c0392b; background: #fdecea; }
.nt-table td { vertical-align: top; }
.nt-table input[type="text"] { width: 11rem; }
.nt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem 1rem; align-items: end; }
.nt-run { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; margin: .5rem 0; }
.nt-run summary { cursor: pointer; }
#nt-box > summary { cursor: pointer; }

/* 3.29: payments reported by members */
#pcl-box > summary { cursor: pointer; }
.pcl-count { display: inline-block; min-width: 1.4em; padding: 0 .45em; border-radius: 999px; background: #c0392b; color: #fff; font-size: .8rem; text-align: center; }
.pcl-count:empty { display: none; }
.pcl-table td { vertical-align: top; }
.pcl-table .sub { display: block; font-size: .82rem; color: var(--muted); }
.pcl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .5rem 1rem; }
.pcl-dup { background: #fff4e0; border: 1px solid #f0c27a; border-radius: 8px; padding: .45rem .7rem; }
#pcl-dialog { width: min(44rem, 94vw); }

/* 3.30: charges to recover from units */
#ch-box > summary { cursor: pointer; }
.ch-grid { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: .5rem 1rem; }
.ch-fill { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: end; margin: .6rem 0; }
.ch-fill label { display: grid; gap: .2rem; }
.ch-scroll { max-height: 26rem; overflow: auto; }
.ch-table input { width: 7.5rem; text-align: right; }
.ch-table tr.on td { background: #f1f8f3; }
@media (max-width: 640px) { .ch-grid { grid-template-columns: 1fr; } }
/* 3.34: activity trail */
.au-table td { vertical-align: top; }
.au-table .sub { display: block; font-size: .8rem; color: var(--muted); }
.au-detail { max-width: 28rem; font-size: .88rem; }
.au-changes { margin: .25rem 0 0; padding-left: 1.1rem; font-size: .82rem; }
.au-fixed { background: #fde8e8; color: #9b1c1c; display: block; margin-top: .2rem; }
.au-undo { background: #e6f4ea; color: #1e6b34; display: block; margin-top: .2rem; }
.au-row-fixed td { background: #fff7f7; }
.au-row-undo td { background: #f4fbf6; }
#au-filters { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: end; margin: 1rem 0; }
