/* ICAA Membership Portal design system (from design/mockups/assets/mockup.css) */
/* ICAA Membership Portal — mockup design system
   Palette taken from icaa.ai (Blocksy theme palette): teal #58abad, cyan #4ddce7,
   slate #4d5d6d, navy #102136, grays #E7EBEE / #F3F5F7 / #FBFBFC. */

/* Contrast (WCAG 2.1 AA, checked by test/ui-rules.test.js):
   --teal is the brand accent for surfaces, rules and marks. It never carries text and white text never sits on it.
   --teal-dark is the same hue, darker: links, ghost buttons, the primary button and anything else that is read
   (4.5:1 or better on every light surface; white on it is 5.4:1). --teal-darker is its hover.
   --muted is the one secondary text colour (4.5:1 or better on every light surface).
   --ok / --warn / --bad / --info are text colours that reach 4.5:1 on white and on their own tint (the pills).
   --line-strong is the border of anything a person operates (fields, buttons): 3:1 on every light surface. */
:root {
  --teal: #58abad; --teal-dark: #337375; --teal-darker: #2d6668; --btn: #bcd5f9; --btn-hover: #a6c6f4; --footer: #2a3a61; --cyan: #4ddce7; --navy: #102136; --slate: #4d5d6d; --muted: #5d6975;
  --g1: #E7EBEE; --g2: #F3F5F7; --g3: #FBFBFC; --white: #ffffff; --line-strong: #6f8799;
  --ok: #287a4d; --ok-bg: #e4f4ea; --warn: #93611a; --warn-bg: #fdf1dc; --bad: #bd382a; --bad-bg: #fbe5e3;
  --info: #2e6c9b; --info-bg: #e3eef8; --gold: #c99a2e; --diamond: #5b6fd8;
  --radius: 10px; --radius-sm: 6px; --shadow: 0 1px 2px rgba(16,33,54,.06), 0 4px 14px rgba(16,33,54,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidenav-w: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--slate); background: var(--g2); }
h1, h2, h3, h4 { color: var(--navy); margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; } h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); }
p { margin: 0 0 .8em; } a { color: var(--teal-dark); text-decoration: none; } a:hover { text-decoration: underline; }
small, .muted { color: var(--muted); font-size: 13px; }
hr { border: 0; border-top: 1px solid var(--g1); margin: 16px 0; }
code { background: var(--g2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }

/* ---------- icons & accessibility ----------
   Icons are monochrome inline SVG from assets/icons.js, drawn with currentColor (never color
   icons or emoji). Decorative icons: aria-hidden="true". Icon-only buttons: aria-label.
   Status icons always sit next to visible or .sr-only text. */
svg.ico { width: 1.1em; height: 1.1em; vertical-align: -0.2em; flex: none; stroke: currentColor; fill: none; }
.sidenav .ico { width: 18px; height: 18px; opacity: .8; }
.icon-btn svg.ico { width: 18px; height: 18px; }
.attention .ic svg.ico { width: 17px; height: 17px; }
.help-fab svg.ico { width: 16px; height: 16px; margin-right: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* One focus ring for everything a person can operate: 3px navy, 2px away from the control (16:1 on light surfaces).
   On the navy footer the ring is white. Fields keep this ring too; they have no softer outline of their own. */
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.site-footer :focus-visible { outline-color: #fff; }
.flash:focus { outline: none; } .flash:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.ok-ic { color: var(--ok); } .bad-ic { color: var(--bad); } .warn-ic { color: var(--warn); } /* tint only; text carries the meaning */

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.logo img { height: 44px; width: auto; display: block; }            /* official ICAA logo: assets/icaa-logo.svg */
.topbar .logo img { height: 36px; }
.site-footer .logo img { height: 40px; }                             /* footer uses the white-text variant on navy */
.logo .mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--teal), var(--cyan)); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; } /* legacy placeholder, unused */
.logo small { display: block; font-weight: 500; font-size: 11px; color: var(--slate); letter-spacing: 0; white-space: nowrap; }
.site-nav a { white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--white); color: var(--navy); border-color: var(--line-strong); line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--g3); text-decoration: none; }
/* The primary button is the owner's pale blue (BCD5F9, 2026-10-16; before it 5A9ABD, 1ADCDD, then 8ABAEF; DR-637) with navy text: white on it is 1.5:1, navy 10.8:1; the hover A6C6F4 is 9.3:1. */
.btn-primary { background: var(--btn); color: var(--navy); border-color: var(--btn); } .btn-primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn-navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--teal-dark); }
.btn-danger { color: var(--bad); border-color: var(--bad); }
.btn-sm { padding: 5px 10px; font-size: 13px; } .btn-lg { padding: 13px 22px; font-size: 16px; }
/* A sign-in button that carries a provider's mark (the official Google "G" and Microsoft logos, in their own colours). */
.btn-sso { justify-content: center; gap: 10px; background: #fff; } .btn-sso img { width: 20px; height: 20px; flex: none; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- public shell ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--g1); }
.site-header .inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 22px; }
.site-nav { display: flex; gap: 18px; margin-left: 24px; font-weight: 500; }
.site-nav a { color: var(--slate); } .site-nav a.active { color: var(--navy); border-bottom: 2px solid var(--teal-dark); padding-bottom: 4px; }
.site-nav .dd::after { content: " ▾"; font-size: 11px; }
.site-header .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.public main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
.public main.narrow { max-width: 860px; }
/* Hero and CTA panels use a light teal tint (no dark-blue card backgrounds); text stays navy/slate for contrast. */
.hero { background: linear-gradient(120deg, #e6f3f3 0%, #eef6f7 55%, #f3f5f7 100%); color: var(--slate); border: 1px solid #d5e8e8; border-radius: 16px; padding: 56px 48px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.hero h1, .hero h2 { color: var(--navy); } .hero h1 { font-size: 40px; } .hero p { color: var(--slate); font-size: 17px; max-width: 560px; }
.hero .btn { background: #fff; color: var(--navy) !important; border-color: var(--line-strong); } .hero .btn-primary { background: var(--btn); color: var(--navy) !important; border-color: var(--btn); }
.hero .placeholder { background: repeating-linear-gradient(45deg, #dfe9ec 0 8px, #eef3f5 8px 16px) !important; border-color: #cfd7de !important; color: #6b7883 !important; }
.tint { background: #eef6f7; border: 1px solid #d5e8e8; }   /* light accent surface for emphasised cards */
.site-footer { background: var(--footer); color: #b9c6d1; padding: 36px 20px; margin-top: 40px; font-size: 13px; }
.site-footer .inner { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.site-footer a { color: #d7e3ea; display: block; margin-bottom: 6px; } .site-footer h4, .site-footer .h4 { color: #fff; }
.section { margin: 40px 0; } .section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 14px; } .section-head .btn-ghost { margin-left: auto; }

/* ---------- app / admin shell ---------- */
.app { display: grid; grid-template-columns: var(--sidenav-w) 1fr; grid-template-rows: 56px 1fr; min-height: calc(100vh - 25px); }
.topbar { grid-column: 1 / -1; background: #fff; border-bottom: 1px solid var(--g1); display: flex; align-items: center; gap: 16px; padding: 0 18px; }
.topbar .search { flex: 1; max-width: 420px; margin-left: 20px; } .topbar .search input { width: 100%; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; display: grid; place-items: center; font-size: 14px; position: relative; }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal-dark); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; text-decoration: none; }
.ws-switch { background: var(--g2); border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 600; }
.sidenav { background: #fff; border-right: 1px solid var(--g1); padding: 14px 10px; }
.sidenav .org { padding: 8px 10px 14px; display: flex; gap: 10px; align-items: center; }
.sidenav .org b { display: block; color: var(--navy); font-size: 14px; line-height: 1.2; }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--slate); font-weight: 500; font-size: 14px; }
.sidenav a:hover { background: var(--g2); text-decoration: none; }
.sidenav a.active { background: #e6f3f3; color: var(--navy); font-weight: 600; box-shadow: inset 3px 0 0 var(--teal-dark); }
.sidenav a .count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; }
.sidenav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 12px 6px; }
/* A collapsible group of menu items (Admin › Portal Configuration): the heading opens and closes it; open when a page inside it is shown. */
.sidenav details.navgroup { margin-top: 6px; }
.sidenav details.navgroup summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--slate); font-weight: 500; font-size: 14px; cursor: pointer; list-style: none; }
.sidenav details.navgroup summary::-webkit-details-marker { display: none; }
.sidenav details.navgroup summary::after { content: '\203A'; margin-left: auto; font-size: 16px; line-height: 1; opacity: .6; transition: transform .15s; }
.sidenav details.navgroup[open] summary::after { transform: rotate(90deg); }
.sidenav details.navgroup summary:hover { background: var(--g2); }
.sidenav details.navgroup a { padding: 7px 12px 7px 40px; font-size: 13px; }
.sidenav .ico { width: 18px; text-align: center; opacity: .75; }
/* Admin uses the same light side menu as members; only the active accent differs (navy) so staff can tell the consoles apart. */
.admin .sidenav { background: var(--g3); }
.admin .sidenav a.active { background: #e6ebf1; color: var(--navy); box-shadow: inset 3px 0 0 var(--navy); }
.admin .sidenav .org small { color: var(--muted); }
.content { padding: 24px 28px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; } .crumbs a { color: var(--muted); }
.help-fab { position: fixed; right: 22px; bottom: 22px; background: var(--navy); color: #fff; border-radius: 999px; padding: 10px 16px; font-weight: 600; box-shadow: var(--shadow); font-size: 14px; }

/* ---------- layout helpers ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-main-side { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.grid-side-main { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 14px; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.right { text-align: right; } .center { text-align: center; }

/* ---------- cards ---------- */
.card { background: #fff; border: 1px solid var(--g1); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card.flat { box-shadow: none; } .card.pad-0 { padding: 0; } .card.pad-0 .card-h { padding: 14px 18px; } .card.pad-0 > .table { border: 0; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; } .card-h h3 { margin: 0; } .card-h .btn, .card-h .pill, .card-h a { margin-left: auto; }
.card-h .btn ~ .btn { margin-left: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: #fff; border: 1px solid var(--g1); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.1; margin: 4px 0 2px; }
.kpi .delta { font-size: 12.5px; } .kpi .delta.up { color: var(--ok); } .kpi .delta.down { color: var(--bad); }
.status-card { border-left: 5px solid var(--teal); }

/* ---------- attention list ---------- */
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--g1); }
.attention li:first-child { border-top: 0; }
.attention .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; flex: none; }
.attention .ic.warn { background: var(--warn-bg); color: var(--warn); } .attention .ic.bad { background: var(--bad-bg); color: var(--bad); } .attention .ic.info { background: var(--info-bg); color: var(--info); } .attention .ic.ok { background: var(--ok-bg); color: var(--ok); }
.attention .btn { margin-left: auto; }

/* ---------- pills & badges ---------- */
/* A pill has one of five tones and nothing else. What a state is called and which tone it gets is decided in
   lib/status.js and printed by the `status` partial; a view never picks a colour for a state.
     ok in force, done · warn waiting, needs attention · bad overdue, failed, blocked · info in progress, informative
     neutral draft, closed, ended, cancelled (also the plain .pill) */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--g2); color: var(--slate); border: 1px solid var(--g1); white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill-bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pill-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.pill-neutral { background: var(--g2); color: var(--slate); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; border: 1px solid var(--g1); background: #fff; color: var(--navy); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.badge-standard::before { background: var(--slate); } .badge-advanced::before { background: var(--teal); } .badge-gold::before { background: var(--gold); } .badge-diamond::before { background: var(--diamond); }
.badge-regional::before { background: var(--info); } .badge-nationwide::before { background: var(--navy); } .badge-cert::before { background: var(--ok); } .badge-fellow::before { background: var(--cyan); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--g1); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
.table th, .table td { padding: 10px 14px; text-align: left; border-top: 1px solid var(--g1); vertical-align: middle; }
.table th { background: var(--g3); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-top: 0; }
.table tr:hover td { background: #fafcfd; } .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .sel { width: 36px; } .table tfoot td { background: var(--g3); font-weight: 600; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; } .chip { background: #fff; border: 1px solid var(--g1); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.chip.on { background: #e6f3f3; border-color: var(--teal-dark); color: var(--navy); font-weight: 600; }
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; font-size: 13px; } .pager span { padding: 4px 9px; border: 1px solid var(--g1); border-radius: 6px; background: #fff; }

/* ---------- forms ---------- */
input, select, textarea { font: inherit; color: var(--navy); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--navy); }
.field { display: block; margin-bottom: 14px; } .field > span, .field label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; } .field.err input { border-color: var(--bad); } .field .error { color: var(--bad); font-size: 12px; margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; } .check input { width: auto; margin-top: 3px; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.radio-card { border: 2px solid var(--g1); border-radius: var(--radius); padding: 14px 16px; background: #fff; cursor: pointer; }
.radio-card.on { border-color: var(--teal-dark); background: #f2fafa; } .radio-card b { display: block; color: var(--navy); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; } .toggle i { width: 36px; height: 20px; border-radius: 10px; background: var(--teal); position: relative; display: inline-block; }
.toggle i::after { content: ""; position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; } .toggle.off i { background: #cfd7de; } .toggle.off i::after { right: auto; left: 2px; }
.counter { font-size: 12px; color: var(--muted); text-align: right; } .counter.max { color: var(--bad); font-weight: 600; }

/* ---------- stepper ---------- */
.stepper { display: flex; gap: 0; margin: 10px 0 26px; counter-reset: s; list-style: none; padding: 0; }
.stepper > * { flex: 1; text-align: center; font-size: 12.5px; color: var(--muted); position: relative; padding-top: 30px; }
.stepper > *::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid #cfd7de; display: grid; place-items: center; font-size: 11px; font-weight: 700; z-index: 1; }
.stepper > *::after { content: ""; position: absolute; top: 11px; left: 50%; width: 100%; height: 2px; background: #cfd7de; } .stepper > *:last-child::after { display: none; }
.stepper .done { color: var(--slate); } .stepper .done::before { background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l4 4L19 7'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--teal); color: transparent; } .stepper .done::after { background: var(--teal); }
.stepper .cur { color: var(--navy); font-weight: 700; } .stepper .cur::before { border-color: var(--teal-dark); color: var(--teal-dark); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--g1); margin-bottom: 18px; overflow-x: auto; }
.tabs a { white-space: nowrap; padding: 10px 14px; color: var(--slate); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--navy); border-color: var(--teal-dark); font-weight: 600; } .tabs a:hover { text-decoration: none; color: var(--navy); }
.tabs a .n { background: var(--g2); border-radius: 10px; font-size: 11px; padding: 1px 6px; margin-left: 4px; }

/* ---------- banners ---------- */
.banner { border-radius: var(--radius); padding: 12px 16px; display: flex; gap: 12px; align-items: center; margin-bottom: 18px; font-size: 14px; }
.banner .btn { margin-left: auto; }
/* (banner children are laid out by the rules in 'responsive layout hardening') */
.banner-warn { background: var(--warn-bg); color: #6b4a0e; border: 1px solid #f0d9a6; } .banner-bad { background: var(--bad-bg); color: #7a2a22; border: 1px solid #efc5c1; } .banner-info { background: var(--info-bg); color: #1f4a6b; border: 1px solid #c8dcef; } .banner-ok { background: var(--ok-bg); color: #1f5d3b; border: 1px solid #bfe3cd; }

/* ---------- price & member cards ---------- */
.price-card { background: #fff; border: 2px solid var(--g1); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--teal); position: relative; } .price-card.featured::before { content: "Most chosen"; position: absolute; top: -12px; left: 20px; background: var(--teal-dark); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.price-card .price { font-size: 32px; font-weight: 800; color: var(--navy); } .price-card .price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.price-card ul { padding-left: 18px; margin: 10px 0 16px; font-size: 14px; } .price-card ul li { margin: 5px 0; } .price-card .btn { margin-top: auto; }
.member-card { background: #fff; border: 1px solid var(--g1); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.member-card .top { display: flex; gap: 12px; align-items: center; } .member-card .name { font-weight: 700; color: var(--navy); line-height: 1.2; } .member-card .tag { font-size: 13px; color: var(--muted); }
.member-card .excerpt { font-size: 13.5px; color: var(--slate); } .member-card .foot { display: flex; gap: 6px; align-items: center; margin-top: auto; font-size: 12px; color: var(--muted); } .member-card .foot .badge { font-size: 11px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; } .tile { background: #fff; border: 1px solid var(--g1); border-radius: 14px; padding: 22px; } .tile .big { font-size: 34px; font-weight: 800; color: var(--navy); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; } .gallery figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.facts dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 10px; } .facts dd { margin: 2px 0 0; color: var(--navy); font-weight: 600; }

/* ---------- thread / chat ---------- */
.msg { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--g1); } .msg:first-child { border-top: 0; }
.msg .who { font-weight: 600; color: var(--navy); font-size: 14px; } .msg .when { font-size: 12px; color: var(--muted); margin-left: 8px; } .msg .body { margin-top: 4px; font-size: 14px; }
.msg.internal { background: #fff8d6; border-radius: 8px; padding: 12px; border: 1px dashed #d9b84a; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; } .kcol { background: var(--g2); border-radius: var(--radius); padding: 10px; } .kcol h4 { margin: 4px 6px 10px; } .kcard { background: #fff; border: 1px solid var(--g1); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 13.5px; } .kcard b { color: var(--navy); display: block; }

/* ---------- misc ---------- */
.sparkline { height: 46px; background: linear-gradient(to top, rgba(88,171,173,.15), transparent); border-bottom: 2px solid var(--teal); border-radius: 4px 4px 0 0; }
.bar { height: 10px; background: var(--g1); border-radius: 5px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--teal-dark); }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { padding: 8px 0 8px 22px; position: relative; font-size: 13.5px; border-left: 2px solid var(--g1); margin-left: 6px; } .timeline li::before { content: ""; position: absolute; left: -7px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); border: 2px solid #fff; }
.drawer { position: fixed; right: 0; top: 25px; bottom: 0; width: 380px; background: #fff; border-left: 1px solid var(--g1); box-shadow: -8px 0 30px rgba(16,33,54,.12); padding: 20px; z-index: 40; }
.diff-add { background: #e4f4ea; } .diff-del { background: #fbe5e3; text-decoration: line-through; color: #8a3a33; }
.map-states { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; } .map-states span { font-size: 10px; text-align: center; padding: 8px 0; background: var(--g1); border-radius: 4px; color: var(--muted); } .map-states span.on { background: var(--teal-dark); color: #fff; font-weight: 700; } .map-states span.some { background: #b5dadb; color: var(--navy); }

@media (max-width: 900px) {
  
  .grid-2, .grid-3, .grid-4, .grid-main-side, .grid-side-main, .tiles, .kanban, .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 32px 22px; } .hero h1 { font-size: 30px; }
  .gallery { grid-template-columns: repeat(2, 1fr); } .site-footer .inner { grid-template-columns: 1fr 1fr; }
}

/* ---------- app additions ---------- */
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
.topbar .wordmark { font-weight: 700; color: var(--navy); margin-left: 10px; }
.topbar .search { display: flex; }
.sidenav a.soon { color: var(--muted); } .sidenav .phase { margin-left: auto; font-size: 10px; background: var(--g2); color: var(--muted); border-radius: 6px; padding: 1px 5px; }
.app { min-height: 100vh; }
.placeholder { background: repeating-linear-gradient(45deg, #e9edf1 0 8px, #f3f5f7 8px 16px); border: 1px solid var(--g1); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; min-height: 80px; }
.ph-logo { width: 56px; height: 56px; border-radius: 12px; min-height: 0; flex: none; } .ph-logo.sm { width: 36px; height: 36px; border-radius: 8px; } .ph-video { aspect-ratio: 16/9; min-height: 0; }
.public main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; } .public main.narrow { max-width: 860px; }

/* home page: Advisory Board teaser */
.person-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; color: var(--slate); }
.person-tile:hover { text-decoration: none; border-color: var(--teal); }
.person-tile b { color: var(--navy); font-size: 16px; line-height: 1.25; } .person-tile small { font-size: 13px; }
.person-photo { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; background: #e6f3f3; border: 1px solid #d5e8e8; color: var(--teal-dark); display: grid; place-items: center; font-weight: 700; font-size: 34px; margin-bottom: 6px; }

/* ---------- platform additions ---------- */
.h3 { font-size: 17px; } .card-h h2 { margin: 0; }
a.icon-btn { color: var(--navy); text-decoration: none; } a.icon-btn:hover { background: var(--g3); }
button.icon-btn { cursor: pointer; color: var(--navy); }
/* Delete on a row, and Delete selected (partials/row-delete.ejs, partials/bulk-delete.ejs; the owner, 2026-10-15) */
.row-del { display: inline-flex; margin: 0; flex: none; }
.icon-btn.icon-btn-sm { width: 32px; height: 32px; } .icon-btn.icon-btn-sm svg.ico { width: 16px; height: 16px; }
button.icon-btn.row-del-btn:hover { background: var(--bad-bg, #fdecec); color: var(--bad); border-color: var(--bad); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; }
.bulk-bar .check { margin: 0; }
.row-pick { flex: none; display: inline-flex; align-items: center; } .row-pick input { width: 18px; height: 18px; margin: 0; }
td.row-pick, th.row-pick { width: 32px; } td.row-act { width: 44px; text-align: right; }
.attention li.pick-row > div { flex: 1; min-width: 0; }
@media (max-width: 640px) {  /* a phone: the text keeps the width, the buttons go under it */
  .attention li.pick-row { flex-wrap: wrap; } .attention li.pick-row > .ic { display: none; }
  .attention li.pick-row > div { flex: 1 1 calc(100% - 40px); } .attention li.pick-row > .btn { margin-left: 30px; }
}
details > summary { cursor: pointer; list-style: none; } details > summary::-webkit-details-marker { display: none; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.status-card.warn { border-left-color: var(--warn); } .status-card.bad { border-left-color: var(--bad); } .status-card.ok { border-left-color: var(--ok); }
.bar i.warn { background: var(--warn); } .bar i.bad { background: var(--bad); } .bar i.ok { background: var(--ok); }
.retail { text-decoration: line-through; color: var(--muted); margin-right: 6px; }
.btn-block { width: 100%; justify-content: center; }
.list-row { display: block; padding: 10px 12px; border: 1px solid var(--g1); border-radius: 8px; margin-bottom: 8px; background: #fff; color: inherit; }
.list-row.on { border-color: var(--teal); background: #f2fafa; }
.kcard.on { border-color: var(--teal); }
.msg.system { justify-content: center; color: var(--muted); font-size: 13px; padding: 8px 0; }
.checklist { list-style: none; padding: 0; margin: 0; } .checklist li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; }
.table th[scope="row"] { background: none; text-transform: none; letter-spacing: 0; font-size: inherit; color: inherit; font-weight: 400; border-top: 1px solid var(--g1); }
.table tbody tr:first-child th[scope="row"] { border-top: 0; } .table tfoot th[scope="row"] { background: var(--g3); font-weight: 600; color: var(--navy); }

/* ---------- responsive layout hardening ---------- */
/* Grid tracks may shrink below their content so a wide table scrolls inside its card instead of widening the page. */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1fr) 340px; }
.grid-side-main { grid-template-columns: 260px minmax(0, 1fr); }
.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kanban { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 > *, .grid-3 > *, .grid-4 > *, .grid-main-side > *, .grid-side-main > *, .tiles > *, .kanban > *, .stack > *, .content, .card { min-width: 0; }
.card.pad-0, .table-wrap { overflow-x: auto; }
.app { grid-template-columns: var(--sidenav-w) minmax(0, 1fr); }
img, iframe, video { max-width: 100%; }
/* long words and URLs wrap, without shrinking table columns to one character */
.card, .member-card, .kcard, .msg .body, .facts dd { overflow-wrap: break-word; }
.card { overflow-x: auto; } /* a table wider than its card scrolls inside the card */
/* banners: text sits in one flexible item (a <span> or <div>) next to an optional action */
.banner > :not(.btn):not(div):not(input):not(select) { display: revert; }
.banner > span, .banner > div { flex: 1 1 auto; min-width: 0; }
.banner > svg.ico { flex: none; }
.banner .btn, .banner form { flex: none; }

/* Public header. Eleven menu items need more room than the page content, so the bar may be wider than <main>.
   Below 1280px the logo and the actions share the first row and the menu scrolls sideways on a second row; above
   that the menu stays on one line and, if a browser still runs short of room, scrolls instead of widening the page. */
.site-header .inner { max-width: 1400px; }
.site-nav { gap: 14px; margin-left: 12px; font-size: 14.5px; min-width: 0; overflow-x: auto; overflow-y: hidden; padding: 4px 3px; } /* padding keeps the focus ring inside the scroll box */
@media (max-width: 1280px) {
  .site-header .inner { flex-wrap: wrap; gap: 8px 12px; }
  .site-header .actions { margin-left: auto; }
  .site-nav { order: 3; flex-basis: 100%; margin-left: 0; gap: 16px; padding: 4px 3px 6px; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 900px) {
  /* public header: logo and actions on the first row, the menu scrolls sideways on the second */
  .site-header .inner { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; }
  .site-header .actions { margin-left: auto; gap: 6px; }
  .site-header .actions .btn { padding: 7px 10px; font-size: 13px; }
  .site-nav { display: flex; order: 3; flex-basis: 100%; margin-left: 0; gap: 16px; overflow-x: auto; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; }
  .logo img { height: 36px; } .topbar .logo img { height: 30px; }
  .public main { padding: 18px 14px 48px; }
  .hero { padding: 26px 18px; grid-template-columns: minmax(0, 1fr); } .hero h1 { font-size: 28px; }
  .site-footer .inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* workspace: top bar wraps, the side menu becomes a sideways-scrolling strip under it */
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .topbar .wordmark { display: none; }
  .topbar .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .topbar .right { gap: 8px; } .topbar .avatar { display: none; }
  .sidenav { display: flex; align-items: center; gap: 2px; overflow-x: auto; white-space: nowrap; border-right: 0; border-bottom: 1px solid var(--g1); padding: 6px 8px; -webkit-overflow-scrolling: touch; }
  .sidenav .org, .sidenav .group { display: none; }
  .sidenav a { flex: none; padding: 8px 10px; }
  .sidenav a.active { box-shadow: inset 0 -3px 0 var(--teal-dark); }
  .admin .sidenav a.active { box-shadow: inset 0 -3px 0 var(--navy); }
  .content { padding: 16px 14px 72px; }
  .page-head { flex-wrap: wrap; gap: 10px; } .page-head .actions { margin-left: 0; flex-wrap: wrap; }
  h1 { font-size: 24px; }
  .grid-2, .grid-3, .grid-4, .grid-main-side, .grid-side-main, .tiles, .kanban, .field-row, .field-row-3 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 14px; } .card.pad-0 { padding: 0; }
  /* wide tables scroll inside their own box */
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .toolbar > *, .row > input, .row > select { max-width: 100%; }
  .tabs { overflow-x: auto; }
  .stepper { overflow-x: auto; } .stepper > * { min-width: 72px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-fab { right: 12px; bottom: 12px; }
  .drawer { width: 100%; }
  input, select, textarea { max-width: 100%; }
}
/* Scroll containers are positioning contexts, so screen-reader-only text inside them cannot widen the page. */
.card.pad-0, .table-wrap, .sidenav, .tabs, .site-nav, .stepper, .table { position: relative; }
fieldset { min-width: 0; } /* browsers default fieldset to min-content, which lets a wide table widen the page */
.tabs { overflow-y: hidden; } /* overflow-x:auto would otherwise show a vertical scroller for the 1px tab underline */

/* ---------- shared interface behaviour (docs/05-developer-guide.md §6) ---------- */
/* Required fields. A control with the `required` attribute gets a red asterisk after its label; no markup is needed
   in the view. Screen readers announce "required" from the attribute, so the asterisk has empty alternative text
   where the browser supports it. Where a rule is checked on the server instead (a draft that may be saved incomplete),
   the view prints <span class="req" aria-hidden="true"> *</span><span class="sr-only"> (required)</span> itself. */
.field:has(:required) > span:first-child::after, .field:has(:required) > label:first-child::after,
fieldset:has(> .radio-cards :required) > legend::after, fieldset.req > legend::after { content: " *"; content: " *" / ""; color: var(--bad); font-weight: 700; }
.req { color: var(--bad); font-weight: 700; }
/* A required control with no visible label of its own (a one-line form in a table row) says "(required)" in its placeholder. */
.form-note { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

/* Radio groups and other grouped controls: fieldset + legend, without the browser's box. */
fieldset.group { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.group > legend { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; padding: 0; }
fieldset.group.inline { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 0; }
fieldset.group.inline > legend { float: left; margin: 0 4px 0 0; }

/* Error page inside a workspace or on the public site */
.error-card { padding: 48px 24px; max-width: 640px; margin-left: auto; margin-right: auto; }
.error-card .muted { font-size: 15px; color: var(--slate); } .error-card .error-ref { font-size: 13px; color: var(--muted); }
.error-actions { justify-content: center; margin-top: 16px; }

/* Lists: the count beside a heading, and an invoice's credit and balance lines */
.list-count { font-size: 13px; color: var(--muted); font-weight: 400; }
.table tr.credit-line th[scope="row"], .table tr.credit-line td { color: var(--ok); }
.table tfoot tr.balance-line th[scope="row"], .table tfoot tr.balance-line td { font-size: 15px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.credit-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; color: var(--muted); } .credit-list b { color: var(--navy); }
.card.pad-0 > .pager { padding: 0 14px 12px; }
/* A heading that keeps the document outline (h1 > h2 > h3) but looks like the small caps label. */
.h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); }
/* ---------- price book draft: the published value beside a field ---------- */
.pb-was { display: block; font-size: 12px; margin-top: 3px; } .pb-was.pb-changed { color: #6b4a0e; font-weight: 600; }

/* A refused form (partials/field.ejs, partials/error-summary.ejs): the field with its message, and the summary that
   links to each field. The summary takes the focus when the page loads; it shows the same ring as everything else. */
.field.err input, .field.err select, .field.err textarea, [aria-invalid="true"] { border-color: var(--bad); }
.error-summary { display: block; } .error-summary ul { margin: 6px 0 0; padding-left: 20px; } .error-summary a { color: inherit; text-decoration: underline; }
.error-summary:focus { outline: none; } .error-summary:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
/* A field of a form that sits in a table row (partials/field.ejs, compact): the label is for screen readers, the
   message sits under the control. The error summary of such a form takes the whole row. */
.field.field-inline { display: inline-flex; flex-direction: column; margin: 0; }
.row > .error-summary { flex: 1 0 100%; margin: 0; }

/* Every press is seen, every wait is shown (DR-636): a press animation on buttons, a spinner on the button that sent a
   form, and the working bar at the top of the page while the next page is on its way. Reduced motion keeps the
   signals and drops the movement. */
@keyframes btn-press { 0% { transform: scale(1); } 40% { transform: scale(.94); } 100% { transform: scale(1); } }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@keyframes busy-slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.btn.is-pressed, button.is-pressed { animation: btn-press .22s ease-out; }
.btn.is-busy, button.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after, button.is-busy::after { content: ""; position: absolute; top: calc(50% - 8px); left: calc(50% - 8px); width: 16px; height: 16px; border: 2px solid var(--navy); border-top-color: transparent; border-radius: 50%; animation: btn-spin .8s linear infinite; }
.btn-primary.is-busy::after, .btn-navy.is-busy::after { border-color: #fff; border-top-color: transparent; }
#busy-bar { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity .15s; background: linear-gradient(90deg, transparent, var(--teal-dark), transparent) no-repeat; background-size: 40% 100%; }
body.is-working #busy-bar { opacity: 1; animation: busy-slide 1.1s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .btn.is-pressed, button.is-pressed { animation: none; outline: 3px solid var(--navy); outline-offset: 2px; }
  .btn.is-busy::after, button.is-busy::after { animation: none; border-style: dotted; border-top-color: var(--navy); }
  .btn-primary.is-busy::after, .btn-navy.is-busy::after { border-top-color: #fff; }
  body.is-working #busy-bar { animation: none; background: var(--teal-dark); }
}

/* A folding section (details.fold): a card that opens on click, its summary a heading and one line of figures (the hub's
   Districts page, 2026-10-16). */
.fold > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { margin: 0; }
.fold > summary::after { content: "Show \25BE"; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--teal-darker); }
.fold[open] > summary::after { content: "Hide \25B4"; }
.hubs-actions { align-items: start; }
