/* DS3 brand layer (DS3 Brand Guidelines): primary purple #5B3A7D and teal #2E8D9A, with the six-colour
   secondary palette used sparingly for accents. Barlow Condensed (SIL OFL, self-hosted) stands in for the
   licensed Zuume Cut headline face. Loaded after site.css and theme.css. */
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ds3-purple: #5b3a7d;
  --ds3-purple-900: #2a1f45;
  --ds3-purple-100: #f1ecf7;
  --ds3-teal: #2e8d9a;
  --ds3-teal-700: #1c6872;
  --ds3-teal-100: #e4f2f3;
  --ds3-pink: #e0318a;
  --ds3-orange: #ee720e;
  --ds3-blue: #0097d8;
  --ds3-green: #5dba93;
  --green-900: var(--ds3-purple-900);
  --green-700: var(--ds3-teal-700);
  --green-600: var(--ds3-teal);
  --green-100: var(--ds3-teal-100);
  --heather-700: var(--ds3-purple);
  --heather-100: var(--ds3-purple-100);
  --paper: #fcfbfd;
  --stone: #f4f2f8;
  --line: #e0dbe9;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', var(--font-body);
}

/* Typography: condensed display headings echo the DS3 wordmark; body stays Atkinson Hyperlegible. */
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0; line-height: 1.02; color: var(--ds3-purple-900); }
h1 { font-size: clamp(2.6rem, 1.6rem + 3.6vw, 4.6rem); }
h2 { font-size: clamp(2rem, 1.5rem + 1.8vw, 2.9rem); }
h3 { font-family: var(--font-body); letter-spacing: -0.01em; color: var(--ds3-purple-900); }
.page-head h1 { font-size: clamp(2.6rem, 1.8rem + 3vw, 4rem); }
.panel h2, .filters h2, .footer h2, .admin-layout h2 { font-family: var(--font-body); letter-spacing: -0.01em; line-height: 1.25; }
.admin-layout h1 { font-size: clamp(2.2rem, 1.6rem + 2vw, 3rem); }
.eyebrow { color: var(--ds3-teal-700); letter-spacing: .14em; }
.site-title .name { font-family: var(--font-display); font-size: 1.85rem; letter-spacing: .01em; color: var(--ds3-purple-900); }

/* Chrome */
.nav a[aria-current='page'] { color: var(--ds3-purple); border-bottom-color: var(--ds3-teal); }
.community-toolbar { background: var(--ds3-purple-100); border-bottom-color: #ddd3ea; }
.community-toolbar a { color: #3f2a5c; }
.btn { background: var(--ds3-teal-700); border-color: var(--ds3-teal-700); }
.btn:hover { background: var(--ds3-purple-900); border-color: var(--ds3-purple-900); }
.btn-secondary { background: #fff; color: var(--ds3-purple-900); border-color: #cfc5de; }
.btn-secondary:hover { background: var(--ds3-purple-100); color: var(--ds3-purple-900); border-color: var(--ds3-purple); }
.btn-quiet { background: transparent; }
.btn-quiet:hover { background: var(--ds3-purple-100); color: var(--ds3-purple-900); border-color: transparent; }
.page-head { background: linear-gradient(110deg, #efe9f6 0%, #f6f4f9 55%, #e3f1f2 100%); border-bottom: 1px solid #e3dcec; }
.section-stone { background: var(--stone); }
.date-block { background: var(--ds3-purple-100); color: var(--ds3-purple-900); }
.date-block .d { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.footer { background: var(--ds3-purple-900); }
.footer-brand strong { font-family: var(--font-display); font-size: 2.2rem; color: #a8dde3; }
.footer h2 { color: #d9cfe8; }
.badge-lab { background: var(--ds3-teal-100); color: #13545c; border-color: #b9dde1; }
.badge-invite { background: #fff; color: var(--ds3-purple); border: 1px dashed #a993c4; }
.notice-invite { border-left-color: var(--ds3-purple); background: var(--ds3-purple-100); }
.tile:first-child { background: #eef7f8; border-color: #cde4e7; }
.tile:nth-child(2) { background: var(--ds3-purple-100); border-color: #ddd2ea; }
.tile:nth-child(3) { background: #fdf1e7; border-color: #f0dbc8; }
.tile:first-child svg { background: #d5ecef; color: var(--ds3-teal-700); }
.tile:nth-child(2) svg { background: #e4d9f0; color: var(--ds3-purple); }
.tile:nth-child(3) svg { background: #fadcc4; color: #8a4207; }
.tile h3 { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; letter-spacing: 0; }

/* Brand stripe: the six DS3 colours as a thin band. */
.brand-stripe { display: flex; height: 8px; }
.brand-stripe span { flex: 1; }
.brand-stripe span:nth-child(1) { background: var(--ds3-purple); }
.brand-stripe span:nth-child(2) { background: var(--ds3-teal); }
.brand-stripe span:nth-child(3) { background: var(--ds3-blue); }
.brand-stripe span:nth-child(4) { background: var(--ds3-green); }
.brand-stripe span:nth-child(5) { background: var(--ds3-orange); }
.brand-stripe span:nth-child(6) { background: var(--ds3-pink); }

/* Home hero */
.hero-brand { background: radial-gradient(120% 90% at 0% 0%, #f1ebf8 0%, #f7f5fa 45%, #e2f1f3 100%); }
.hero-brand .hero-grid { padding-bottom: 4rem; }
.hero-brand h1 { max-width: none; font-size: clamp(3rem, 1.6rem + 4vw, 5.2rem); }
.hero-brand h1 .h-line { display: block; white-space: nowrap; }
.hero-brand h1 .h-accent { color: var(--ds3-teal-700); }
.hero-brand .lead { color: #4a4458; }
.hero-brand .hero-photo { border-radius: 24px; border: 0; box-shadow: 0 24px 60px #2a1f4524; transform: rotate(1.2deg); }
.hero-brand .hero-photo img { aspect-ratio: 16 / 11; object-fit: cover; }
.hero-brand .hero-photo, .hero-brand .hero-photo figcaption { background: var(--ds3-purple-900); }
.hero-brand .hero-note { color: #4a4458; }

/* Impact band */
.impact-band { background: var(--ds3-purple-900); color: #fff; padding: 2.4rem 0 1.6rem; }
.impact-band-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.impact-band-list li { margin: 0; padding-top: 1rem; border-top: 3px solid var(--ds3-teal); max-width: none; }
.impact-band-list li:nth-child(2) { border-top-color: var(--ds3-orange); }
.impact-band-list li:nth-child(3) { border-top-color: var(--ds3-pink); }
.impact-band-list li:nth-child(4) { border-top-color: var(--ds3-green); }
.impact-band .n { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(2.6rem, 2rem + 2vw, 3.6rem); line-height: 1; }
.impact-band .flag { font-size: .55em; vertical-align: super; color: #f6c99c; margin-left: .1em; }
.impact-band .l { display: block; margin-top: .4rem; color: #ddd5ea; font-size: .95rem; line-height: 1.4; }
.impact-band-foot { margin: 1.4rem 0 0; font-size: .85rem; color: #c9bfdb; max-width: none; }
.impact-band-foot a, .impact-band-foot a:visited { color: #fff; }
.home-search { background: transparent; padding: 2.5rem 0 0; }

/* Mobile Labs on tour */
.tour { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 1.5rem 3rem; }
.tour-month-h { font-family: var(--font-display); font-size: 1.5rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ds3-purple); margin: 0 0 .9rem; padding-bottom: .5rem; border-bottom: 2px solid var(--line); }
.tour-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.tour-stop { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ds3-teal); border-radius: 12px; padding: .9rem 1rem; margin: 0; max-width: none; }
.tour-stop.is-invited { border-left-color: #a993c4; }
.tour-stop .date-block { min-width: 3.6rem; padding: .45rem; }
.tour-stop .date-block .d { font-size: 1.8rem; }
.tour-title { font-weight: 700; font-size: 1.05rem; color: var(--ds3-purple-900); text-decoration: none; }
.tour-title:hover { text-decoration: underline; }
.tour-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .25rem 0 .45rem; font-size: .875rem; color: var(--ink-soft); }
.tour-meta svg { width: 15px; height: 15px; flex-shrink: 0; }
.tour-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 1.4rem 1.6rem; border-radius: 16px; background: var(--ds3-teal-100); border: 1px solid #c7e3e6; }
.tour-cta p { margin: 0; }

/* Smart Places promo */
.smart-promo { background: linear-gradient(120deg, var(--ds3-purple-100), #fff 70%); }
.smart-art { margin: 0; background: #fff; border-radius: 20px; padding: 1.6rem 1.8rem 1rem; border: 1px solid #e3dbee; box-shadow: 0 16px 40px #2a1f4512; }
.smart-art svg { width: 100%; height: auto; }
.smart-art-l { font: 700 13px var(--font-body); fill: #3e3651; }
.smart-art figcaption { font-size: .75rem; color: var(--ink-soft); text-align: right; }

/* Community mosaic */
.area-mosaic { list-style: none; padding: 0; margin: 1.5rem 0 1rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.area-tile { position: relative; margin: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--ds3-purple-900); max-width: none; }
.area-tile:first-child { grid-column: span 2; aspect-ratio: auto; }
.area-tile img, .area-tile svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.area-tile a { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 1rem 1.1rem; color: #fff; text-decoration: none; background: linear-gradient(180deg, transparent 35%, #1c1430d9 100%); }
.area-tile:hover img { transform: scale(1.04); }
.area-tile a:focus-visible { background: linear-gradient(180deg, transparent 20%, #1c1430f0 100%); box-shadow: inset 0 0 0 4px var(--gorse); color: #fff; }
.area-j { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #d9cfe8; }
.area-n { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1.05; }
.area-tile:first-child .area-n { font-size: 2.2rem; }

/* Impact page */
.measure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.measure { display: flex; flex-direction: column; gap: .3rem; padding: 1.3rem 1.4rem; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--ds3-teal); border-radius: 14px; }
.measure-wp1 { border-top-color: var(--ds3-purple); }
.measure-wp { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
.measure-value { font-family: var(--font-display); font-weight: 700; font-size: 3.2rem; line-height: 1; color: var(--ds3-purple-900); display: flex; align-items: baseline; gap: .5rem; }
.measure-flag { font-family: var(--font-body); font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: #8a4207; background: #fdf1e7; border-radius: 5px; padding: .1rem .45rem; }
.measure-label { font-weight: 700; line-height: 1.35; }
.measure-asof { font-size: .82rem; color: var(--ink-soft); }
.sources { margin-top: 1.25rem; font-size: .92rem; }
.sources summary { cursor: pointer; font-weight: 700; color: var(--ds3-teal-700); }
.impact-subhead { margin-top: 1rem; }
.impact-stat .impact-value { font-family: var(--font-display); }
.progress { height: 10px; background: #ece8f3; border-radius: 99px; overflow: hidden; margin: .2rem 0 .35rem; min-width: 9rem; }
.progress span { display: block; height: 100%; background: var(--ds3-teal); border-radius: 99px; }
.measure-form { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: end; }
.measure-form label { display: flex; flex-direction: column; font-size: .8rem; font-weight: 700; gap: .2rem; }
.measure-form input:not([type=checkbox]) { padding: .4rem .5rem; font-size: .9rem; }
.measure-form input[name=source] { min-width: 14rem; }
.measure-form .check { font-size: .85rem; }
.measure-table th[scope=row] { min-width: 14rem; font-weight: 700; }

/* Smart Places check */
.smart-intro { max-width: 60rem; margin-bottom: 2rem; }
.smart-facts { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.smart-facts li { margin: 0; padding: 1.1rem 1.2rem; border-radius: 14px; background: var(--ds3-purple-100); display: flex; flex-direction: column; gap: .2rem; max-width: none; }
.smart-facts li:nth-child(2) { background: var(--ds3-teal-100); }
.smart-facts li:nth-child(3) { background: #fdf1e7; }
.smart-facts strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--ds3-purple-900); }
.smart-facts span { font-size: .92rem; color: var(--ink-soft); }
.smart-form { max-width: 60rem; }
.smart-step { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.6rem 1.8rem; margin-bottom: 1.25rem; }
.smart-theme { border-top: 5px solid var(--theme); }
.smart-step h2 { display: flex; align-items: center; gap: .75rem; font-size: 1.9rem; margin-bottom: 1.1rem; }
.step-n { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--theme, var(--ds3-purple)); color: #fff; font-size: 1.2rem; flex-shrink: 0; }
.likert { border: 0; padding: 0; margin: 0 0 1.4rem; }
.likert legend { font-weight: 700; font-size: 1.05rem; margin-bottom: .6rem; padding: 0; max-width: 55ch; }
.likert-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, .9fr); gap: .4rem; }
.likert-opt { position: relative; }
.likert-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.likert-opt label { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: .4rem .3rem; border: 1px solid #cfc5de; border-radius: 10px; font-size: .82rem; line-height: 1.2; background: #fff; color: var(--ink); cursor: pointer; }
.likert-dk label { border-style: dashed; color: var(--ink-soft); }
.likert-opt input:hover + label { border-color: var(--theme, var(--ds3-purple)); }
.likert-opt input:checked + label { background: var(--theme, var(--ds3-purple)); border-color: var(--theme, var(--ds3-purple)); color: #fff; font-weight: 700; }
.likert-opt input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--gorse); }
.likert.field-error .likert-options { outline: 2px solid var(--red-700); outline-offset: 4px; border-radius: 10px; }
.checks-inline { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.smart-result { position: relative; }
.smart-overall { float: right; display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; border-radius: 14px; background: var(--ds3-purple-100); margin: 0 0 1rem 1rem; font-size: .9rem; }
.smart-overall-n { font-family: var(--font-display); font-size: 3rem; font-weight: 700; line-height: 1; color: var(--ds3-purple-900); }
.score-bars { clear: both; display: grid; gap: .9rem; margin: 1rem 0; }
.score-label { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; margin-bottom: .3rem; }
.score-word { font-weight: 400; color: var(--ink-soft); font-size: .85rem; margin-left: .3rem; }
.score-track { position: relative; height: 14px; border-radius: 99px; background: #eeeaf4; }
.score-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--theme); min-width: 14px; }
.score-mark { position: absolute; top: -4px; width: 4px; height: 22px; margin-left: -2px; border-radius: 2px; }
.score-mark-area { background: var(--ds3-purple-900); }
.score-mark-region { background: #fff; box-shadow: 0 0 0 2px var(--ds3-purple-900); }
.score-key { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-soft); margin: 0; max-width: none; }
.legend-inline { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .85rem; }
.legend-inline li { margin: 0; display: flex; align-items: center; gap: .4rem; }
.lg { display: inline-block; width: 18px; height: 10px; border-radius: 5px; }
.lg-mine { background: linear-gradient(90deg, var(--ds3-teal), var(--ds3-purple)); }
.lg-area { width: 4px; height: 16px; background: var(--ds3-purple-900); }
.lg-region { width: 4px; height: 16px; background: #fff; box-shadow: 0 0 0 2px var(--ds3-purple-900); }
.next-card { border-top: 4px solid var(--theme); }
.next-card .eyebrow { color: var(--ds3-purple-900); }
.prio-list { list-style: none; padding: 0; display: grid; gap: .5rem; max-width: 46rem; }
.prio-list li { display: grid; grid-template-columns: 15rem 1fr 2.5rem; gap: 1rem; align-items: center; margin: 0; max-width: none; }
.prio-bar { height: 12px; background: #eeeaf4; border-radius: 99px; overflow: hidden; }
.prio-bar span { display: block; height: 100%; background: var(--theme); }
.prio-n { font-weight: 700; text-align: right; }
.results-table td.heat { text-align: center; font-weight: 700; background: color-mix(in srgb, var(--ds3-teal) calc(var(--v, 0) * 45%), #fff); }

@media (max-width: 59.99rem) {
  .impact-band-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .area-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-brand .hero-photo { transform: none; }
  .likert-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 39.99rem) {
  .hero-brand h1 { font-size: 3rem; }
  .impact-band-list { gap: 1.1rem; }
  .impact-band .n { font-size: 2.4rem; }
  .area-tile:first-child { aspect-ratio: 16 / 9; }
  .smart-facts { grid-template-columns: 1fr; }
  .smart-step { padding: 1.2rem 1.1rem; }
  .likert-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .likert-dk { grid-column: span 2; }
  .prio-list li { grid-template-columns: 1fr 2.5rem; }
  .prio-bar { grid-column: 1 / -1; grid-row: 2; }
  .smart-overall { float: none; margin: 0 0 1rem; }
  .tour-cta { padding: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) { .area-tile img { transition: none; } .area-tile:hover img { transform: none; } }
@media print { .impact-band, .brand-stripe, .tour-cta, .smart-promo { display: none; } }
.hero-brand h1 .h-line { color: var(--ds3-purple-900); }
.hero-brand h1 .h-line.h-accent { color: var(--ds3-teal-700); }

/* Facebook Page management */
.fb-msg { white-space: pre-line; max-width: 34rem; }
.badge.fb-sent { background: var(--ds3-teal-100); color: #13545c; border-color: #b9dde1; }
.badge.fb-scheduled { background: var(--ds3-purple-100); color: var(--ds3-purple); border-color: #d6c9e6; }
.badge.fb-failed { background: #fbe8e5; color: #a12a1e; border-color: #f0c4bd; }
.badge.fb-deleted, .badge.fb-draft { background: #f1f0f3; color: #4a4458; }
.fb-status code { font-size: .85em; }
.fb-section { margin-top: 2.5rem; }
.fb-tabs { margin-bottom: 1.5rem; }
.fb-compose-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
.fb-compose-head h2 { margin: 0; }
.fb-thread { margin-top: 1.25rem; }
.fb-thread-post { margin-bottom: 1rem; max-width: none; }
.fb-comments { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.fb-comments li { margin: 0; max-width: none; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.fb-comments li.is-hidden { opacity: .75; border-style: dashed; }
.fb-comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .3rem; font-size: .95rem; }
.fb-comment-text { margin: 0 0 .6rem; white-space: pre-line; }
.fb-comment-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.fb-reply { display: flex; gap: .5rem; flex: 1 1 18rem; min-width: 0; }
.fb-reply input { flex: 1; min-width: 0; padding: .45rem .7rem; }
.fb-chart { margin: 0; max-width: 46rem; }
.fb-chart svg { width: 100%; height: auto; overflow: visible; }
.fb-grid { stroke: var(--line); stroke-width: 1; }
.fb-axis { fill: var(--ink-soft); font: 12px var(--font-body); font-variant-numeric: tabular-nums; }
.fb-line { fill: none; stroke: var(--ds3-teal-700); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fb-area { fill: var(--ds3-teal); fill-opacity: .12; }
.fb-dot { fill: var(--ds3-teal-700); stroke: #fff; stroke-width: 2; }
.fb-stats-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stat .n { font-family: var(--font-display); }
.fb-stats-table th { text-align: left; }
.fb-stats-table th.num, .fb-stats-table td.num { text-align: right; padding-left: 1.25rem; }

/* Facebook links */
.fb-header svg { color: #1877f2; }
.fb-share { display: inline-flex; align-items: center; gap: .45rem; }
.fb-share svg { flex-shrink: 0; }
@media (max-width: 39.99rem) {
  /* Icon only on phones so the header tools stay on one row; the link keeps its full accessible name. */
  .fb-header .fb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fb-header { min-width: 44px; justify-content: center; }
}

/* Event check-in (QR self check-in, staff counts, printable poster) */
.btn-large { font-size: 1.15rem; padding: .85rem 1.6rem; }
.checkin-page .checkin-when { font-weight: 600; color: var(--ds3-purple-900); }
.checkin-card { border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; background: var(--paper); margin: 1.25rem 0; }
.checkin-card h2 { margin-top: 0; }
.checkin-done p { font-size: 1.15rem; }
.rating-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.rating-opt input { position: absolute; opacity: 0; }
.rating-opt label { display: inline-block; min-width: 44px; min-height: 44px; padding: .55rem .8rem; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--ds3-orange); background: #fff; font-size: 1.1rem; letter-spacing: .05em; }
.rating-opt input:checked + label { border-color: var(--ds3-purple); background: var(--ds3-purple-100); }
.rating-opt input:focus-visible + label { outline: 3px solid var(--ds3-teal-700); outline-offset: 2px; }
.checkin-admin { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) { .checkin-admin { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); } }
.checkin-qr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .5rem; max-width: 22rem; }
.checkin-qr svg { display: block; width: 100%; height: auto; }
.checkin-url code { word-break: break-all; font-size: .9rem; }
.checkin-count { margin: 1.5rem 0 1rem; }
.checkin-count h2 { font-size: 1.25rem; }
.checkin-count details { margin-top: 1rem; }
.checkin-poster { text-align: center; max-width: 40rem; margin: 0 auto; padding: 2rem 1rem; }
.checkin-poster .poster-logo, .checkin-poster .poster-funder { display: block; margin-left: auto; margin-right: auto; }
.checkin-poster .poster-logo { width: 14rem; height: auto; }
.checkin-poster .poster-kicker { font-family: var(--font-display); font-size: 1.6rem; color: var(--ds3-teal-700); text-transform: uppercase; margin: 1rem 0 .25rem; }
.checkin-poster h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0 0 .5rem; color: var(--ds3-purple-900); }
.checkin-poster .poster-when { font-size: 1.2rem; }
.checkin-poster .poster-qr { margin: 1.25rem auto; max-width: 20rem; border-width: 3px; border-color: var(--ds3-purple); }
.checkin-poster .poster-steps { font-size: 1.2rem; max-width: 30rem; margin: 0 auto 1rem; }
.checkin-poster .poster-url { font-weight: 600; word-break: break-all; }
.checkin-poster .poster-funder { width: 12rem; height: auto; margin-top: 1.5rem; }
@media print {
  .checkin-poster-wrap { padding: 0; }
  .checkin-poster { padding: 0; }
  .checkin-poster .poster-qr { max-width: 11cm; }
  body:has(.checkin-poster) .funding, body:has(.checkin-poster) .community-toolbar, body:has(.checkin-poster) footer { display: none !important; }
}

/* Monthly report */
.report-picker { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1.5rem; }
.report-picker .field { margin: 0; }
.report-section { margin-top: 2.25rem; }
.report-section h2 { margin-bottom: .75rem; }
.report-note { font-size: .95rem; }
.data td.num, .data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Irish language switch and translation review */
.lang-switch svg { flex-shrink: 0; }
.translation-table { table-layout: fixed; width: 100%; min-width: 40rem; }
.translation-table th:nth-child(1) { width: 38%; }
.translation-table th:nth-child(3) { width: 6.5rem; }
.translation-table .tr-en { display: block; margin-bottom: .35rem; }
.translation-table textarea { width: 100%; min-height: 2.6rem; font: inherit; padding: .45rem .6rem; resize: vertical; }
.translation-table .tr-approve { text-align: center; }
.translation-table .tr-approve input { width: 1.4rem; height: 1.4rem; }

/* Desktop-only Facebook QR code in the footer (phone users tap the Facebook link instead) */
.footer-qr { display: none; }
@media (min-width: 64rem) {
  .footer-brand { display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
  .footer-qr { display: flex; align-items: center; gap: 1rem; max-width: 17rem; }
  .footer-qr svg { width: 104px; height: 104px; flex-shrink: 0; border-radius: 8px; }
  .footer-qr p { margin: 0; font-size: .95rem; color: #d8d2e6; line-height: 1.4; }
}
@media print { .footer-qr { display: none !important; } }

/* ---------- Layout polish (alignment audit, October 2026) ---------- */
/* Empty states: a styled title rather than a heading, so heading levels never skip */
.empty .empty-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.2; color: var(--ds3-purple-900); margin: 0 0 .4rem; }

/* Every table inside .table-wrap gets the standard table style, not only table.data */
.table-wrap > table:not(.data):not(.calendar):not(.labcal) { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table-wrap > table:not(.data):not(.calendar):not(.labcal) th,
.table-wrap > table:not(.data):not(.calendar):not(.labcal) td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap > table:not(.data):not(.calendar):not(.labcal) thead th { background: var(--stone); font-weight: 700; white-space: nowrap; }
.table-wrap > table:not(.data):not(.calendar):not(.labcal) tr:last-child td { border-bottom: 0; }
.results-table td.heat { text-align: center; }

/* Language switch: full word on larger screens, two letters on phones */
.ls-short { display: none; }

@media (max-width: 39.99rem) {
  /* Phone header: icons only on one tidy row; names stay available to screen readers */
  .header-tools { gap: 0 .1rem; }
  .header-tools .icon-link { min-width: 44px; justify-content: center; padding: .5rem .4rem; }
  .header-tools .icon-link > span:not(.count):not(.visually-hidden) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .header-tools .ls-short { display: inline; font-size: .85rem; letter-spacing: .03em; }
  .header-tools .lang-switch svg { display: none; }
  .header-tools .lang-switch .ls-short { border: 1.5px solid currentColor; border-radius: 6px; padding: .05rem .3rem; font-size: .8rem; }
  .header-tools .menu-toggle { margin-left: auto; min-width: 44px; min-height: 44px; justify-content: center; padding: .4rem .55rem; }
  .header-tools .menu-toggle .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .header-tools .icon-link { min-width: 38px; padding: .5rem .25rem; }

  /* Tables scroll sideways instead of squeezing words letter by letter */
  table.data th, table.data td,
  .table-wrap > table th, .table-wrap > table td { min-width: 7.5rem; }
  table.data tr > :first-child, .table-wrap > table tr > :first-child { min-width: 10rem; }
  table.data td:has(> form), table.data th:has(> .visually-hidden:only-child) { min-width: 0; }
}

/* Manage menu collapsed on small screens */
details.admin-menu > summary { cursor: pointer; font-weight: 700; padding: .55rem .75rem; min-height: 44px; display: flex; align-items: center; color: var(--ds3-purple-900); }
details.admin-menu[open] > summary { margin-bottom: .5rem; border-bottom: 1px solid var(--line); }
@media (max-width: 61.99rem) { .admin-nav { padding: .5rem !important; } .admin-nav > p { display: none; } }

/* Directory cards without a photo get a branded panel the same size, so cards in a row line up */
.card-photo-blank { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--ds3-purple-100), var(--ds3-teal-100)); color: var(--ds3-purple); }
.card-photo-blank svg { width: 44px; height: 44px; opacity: .55; }

/* Narrow pages (forms, short content) line up with the page title on the left instead of floating in the centre */
.container.narrow { max-width: var(--container); }
.container.narrow > * { max-width: 43.5rem; }
.container.narrow > .table-wrap, .container.narrow > .checkin-poster { max-width: 100%; }

/* ---------- Private discussion groups and WhatsApp-style group chat ---------- */
.count[hidden] { display: none; }
.group-head { padding-top: 1rem; }
.group-head h1 { margin-bottom: .75rem; }
.group-tabs ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; margin: 0 0 1rem; padding: 0; border-bottom: 1px solid var(--line); }
.group-tabs li { max-width: none; }
.group-tabs a { display: inline-block; padding: .55rem .1rem; text-decoration: none; font-weight: 700; color: var(--ink-soft); border-bottom: 3px solid transparent; }
.group-tabs a[aria-current='page'] { color: var(--ds3-purple-900); border-bottom-color: var(--ds3-teal); }
.group-privacy { margin-top: .75rem; }
.group-panel h2 { margin-bottom: .4rem; }

/* Group list, in the style of a messaging app's chat list */
.group-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.group-list li { max-width: none; border-bottom: 1px solid var(--line); }
.group-list li:last-child { border-bottom: 0; }
.group-row { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; text-decoration: none; color: var(--ink); min-height: 64px; }
.group-row:hover, .group-row:focus-visible { background: var(--ds3-purple-100); }
.group-avatar { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--ds3-purple); color: #fff; font-weight: 700; font-size: 1.15rem; }
.group-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.group-name { font-weight: 700; color: var(--ds3-purple-900); }
.group-sub { color: var(--ink-soft); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; font-size: .85rem; color: var(--ink-soft); }
.group-flags { display: flex; gap: .35rem; align-items: center; }
.group-unread { display: inline-block; min-width: 1.6em; padding: 0 .45em; border-radius: 999px; background: var(--ds3-teal-700); color: #fff; font-weight: 700; text-align: center; line-height: 1.6; }

/* Chat */
.chat-container { padding-bottom: 2rem; }
.chat-shell { position: relative; display: flex; flex-direction: column; height: min(78vh, 48rem); min-height: 26rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.chat-top { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; background: var(--ds3-purple-900); color: #fff; }
.chat-top a, .chat-top summary { color: #fff; }
.chat-back { display: none; text-decoration: none; font-size: 1.4rem; min-width: 44px; min-height: 44px; place-items: center; }
.chat-top .group-avatar { width: 2.4rem; height: 2.4rem; background: var(--ds3-teal); }
.chat-title { flex: 1; min-width: 0; }
.chat-title h1 { color: #fff; font-family: var(--font-body); font-size: 1.15rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title p { margin: 0; font-size: .85rem; opacity: .9; }
.chat-menu { position: relative; }
.chat-menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; min-width: 44px; min-height: 44px; font-size: 1.4rem; border-radius: 50%; }
.chat-menu summary::-webkit-details-marker { display: none; }
.chat-menu summary:focus-visible { outline: 3px solid #fff; }
.chat-menu ul { position: absolute; right: 0; top: 100%; z-index: 5; min-width: 15rem; margin: .25rem 0 0; padding: .35rem 0; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(42,31,69,.18); }
.chat-menu li { max-width: none; }
.chat-menu ul a { display: block; padding: .6rem 1rem; color: var(--ink); text-decoration: none; }
.chat-menu ul a:hover, .chat-menu ul a:focus-visible { background: var(--ds3-purple-100); }
.chat-banner { padding: .35rem .9rem; font-size: .9rem; background: var(--gorse-100, #fdf3d6); color: var(--ink); text-align: center; }
.chat-banner.is-error { background: #fbe9e7; color: #6e1a12; font-weight: 700; }
.chat-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: .75rem .75rem 1rem; background: var(--stone); }
.chat-scroll:focus-visible { outline: 3px solid var(--ds3-teal); outline-offset: -3px; }
.chat-older, .chat-loading { text-align: center; margin: .25rem 0 .75rem; color: var(--ink-soft); }
.chat-empty { text-align: center; margin: 3rem auto; max-width: 26rem; color: var(--ink-soft); }
.chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-list > li { max-width: none; }
.day-sep, .unread-sep { display: flex; justify-content: center; margin: .9rem 0 .5rem; }
.day-sep span { background: #fff; color: var(--ink-soft); border-radius: 8px; padding: .15rem .7rem; font-size: .85rem; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.unread-sep span { width: 100%; text-align: center; background: var(--ds3-purple-100); color: var(--ds3-purple-900); font-weight: 700; font-size: .85rem; padding: .25rem; border-radius: 6px; }
.msg { position: relative; display: flex; align-items: flex-start; gap: .25rem; margin-top: .5rem; }
.msg.grouped { margin-top: 0; }
.msg.mine { flex-direction: row-reverse; }
.bubble { max-width: min(78%, 36rem); padding: .4rem .6rem .3rem; border-radius: 10px; background: #fff; box-shadow: 0 1px 1px rgba(42,31,69,.12); overflow-wrap: anywhere; }
.msg.theirs:not(.grouped) .bubble { border-top-left-radius: 2px; }
.msg.mine .bubble { background: var(--ds3-teal-100); }
.msg.mine:not(.grouped) .bubble { border-top-right-radius: 2px; }
.msg.flash .bubble { outline: 3px solid var(--ds3-orange); }
.msg-sender { margin: 0 0 .1rem; font-weight: 700; font-size: .9rem; }
.name-c0 { color: #5b3a7d; } .name-c1 { color: #1c6872; } .name-c2 { color: #a3195b; } .name-c3 { color: #8f4500; } .name-c4 { color: #0b5f8a; } .name-c5 { color: #2f6b3f; }
.msg-text { margin: 0; white-space: pre-wrap; max-width: none; line-height: 1.45; }
.msg-text.msg-removed { font-style: italic; color: var(--ink-soft); }
.msg-note { margin: .2rem 0 0; font-size: .8rem; font-weight: 700; color: #6e1a12; }
.msg-meta { display: flex; justify-content: flex-end; gap: .3rem; font-size: .75rem; color: var(--ink-soft); margin-top: .1rem; }
.msg-quote { display: block; width: 100%; text-align: left; margin: .1rem 0 .3rem; padding: .3rem .5rem; border: 0; border-left: 4px solid var(--ds3-teal); border-radius: 6px; background: rgba(42,31,69,.06); font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.msg-quote strong { display: block; font-size: .85rem; }
.msg-quote span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-retry { display: block; margin-top: .3rem; border: 0; background: none; padding: .2rem 0; color: #a3191f; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; text-decoration: underline; }
.msg.is-failed .bubble { box-shadow: 0 0 0 2px #e7a39b; }
.msg-more { flex: none; align-self: center; min-width: 36px; min-height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); font-size: 1.2rem; cursor: pointer; opacity: 0; }
.msg:hover .msg-more, .msg-more:focus-visible, .msg-more[aria-expanded='true'] { opacity: 1; }
.msg-more:focus-visible { outline: 3px solid var(--ds3-teal); }
@media (hover: none) { .msg-more { opacity: .7; min-width: 32px; } }
.msg-menu { position: absolute; top: 100%; z-index: 6; min-width: 12rem; padding: .3rem 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(42,31,69,.2); }
.msg.mine .msg-menu { right: 2.5rem; } .msg.theirs .msg-menu { left: 2rem; }
.msg-menu button { display: block; width: 100%; text-align: left; min-height: 44px; padding: .5rem 1rem; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.msg-menu button:hover, .msg-menu button:focus-visible { background: var(--ds3-purple-100); outline: none; }
.msg-menu-q { margin: .4rem 1rem; font-weight: 700; }
.chat-jump { position: absolute; right: 1rem; bottom: 6.5rem; z-index: 4; min-height: 44px; padding: .4rem .9rem; border: 0; border-radius: 999px; background: var(--ds3-purple-900); color: #fff; font: inherit; font-weight: 700; box-shadow: 0 4px 12px rgba(42,31,69,.3); cursor: pointer; }
.chat-composer { padding: .5rem .6rem calc(.4rem + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.chat-compose-row { display: flex; align-items: flex-end; gap: .5rem; }
.chat-compose-row textarea { flex: 1; min-height: 44px; max-height: 8rem; resize: none; padding: .6rem .85rem; border: 1px solid var(--line-strong); border-radius: 22px; font: inherit; line-height: 1.4; }
.chat-compose-row textarea:focus { outline: 3px solid var(--ds3-teal); outline-offset: 0; border-color: var(--ds3-teal-700); }
.chat-send { flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--ds3-teal-700); color: #fff; font-size: 1.25rem; cursor: pointer; }
.chat-send:hover { background: var(--ds3-purple); }
.chat-send:focus-visible { outline: 3px solid var(--ds3-orange); outline-offset: 2px; }
.chat-send:disabled { background: var(--line-strong); cursor: not-allowed; }
.chat-hint { display: flex; justify-content: space-between; gap: 1rem; margin: .2rem .5rem 0; font-size: .8rem; color: var(--ink-soft); max-width: none; }
.chat-count { margin-left: auto; }
.chat-reply-preview { display: flex; align-items: center; gap: .5rem; margin: 0 0 .4rem; padding: .35rem .6rem; border-left: 4px solid var(--ds3-teal); border-radius: 6px; background: var(--stone); }
.chat-reply-preview > div { flex: 1; min-width: 0; }
.chat-reply-preview strong { display: block; font-size: .85rem; }
.chat-reply-preview span { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-icon-btn { min-width: 44px; min-height: 44px; border: 0; background: none; font-size: 1.1rem; cursor: pointer; }
.chat-readonly { margin: 0; padding: .9rem; text-align: center; background: #fff; border-top: 1px solid var(--line); color: var(--ink-soft); }
.chat-dialog { max-width: 30rem; width: calc(100% - 2rem); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.chat-dialog::backdrop { background: rgba(42,31,69,.45); }
.chat-plain { padding: 1rem 1.5rem; }
.chat-plain li { margin-bottom: .75rem; white-space: pre-wrap; }

/* In-app alerts */
.alert-toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; display: flex; flex-direction: column; gap: .5rem; max-width: min(24rem, calc(100vw - 2rem)); }
.alert-toast { display: flex; align-items: center; gap: .75rem; padding: .75rem .75rem .75rem 1rem; background: var(--ds3-purple-900); color: #fff; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(42,31,69,.35); }
.alert-toast p { margin: 0; flex: 1; max-width: none; }
.alert-toast .btn { background: #fff; color: var(--ds3-purple-900); border-color: #fff; box-shadow: none; }
.alert-toast-close { min-width: 40px; min-height: 40px; border: 0; background: none; color: #fff; font-size: 1rem; cursor: pointer; }

/* Threaded discussions */
.thread-list { list-style: none; padding: 0; margin: 0; }
.thread-list li { max-width: none; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.thread-list h2 { font-family: var(--font-body); font-size: 1.15rem; margin: 0 0 .25rem; }
.thread-item.is-pinned { background: var(--gorse-100, #fdf3d6); padding: 1rem; border-radius: var(--radius); border-bottom: 0; margin-bottom: .5rem; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: .75rem 0; max-width: 70ch; }
.reply-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.reply { max-width: none; padding: .9rem 1rem; margin-bottom: .75rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.reply .post-body { margin: .25rem 0 .5rem; }
.item-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; margin-top: .5rem; }
.item-actions form, .inline-form { display: inline; margin: 0; }
.report-box summary { cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; padding: 0 .5rem; color: var(--ink-soft); text-decoration: underline; }
.report-box form { margin-top: .5rem; padding: .75rem; background: var(--stone); border-radius: var(--radius-sm); }
.request-note { margin: .5rem 0; padding: .5rem .9rem; border-left: 4px solid var(--line-strong); background: var(--stone); white-space: pre-wrap; }
.decision-form .field { max-width: 28rem; }

@media (max-width: 47.99rem) {
  /* Phones: the chat fills the screen and stays above the on-screen keyboard (height set by discussions.js). */
  .chat-container { padding-left: 0; padding-right: 0; padding-bottom: 0; }
  /* Full-screen chat pinned to the visible area; discussions.js follows the on-screen keyboard. */
  .chat-shell { position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: 100dvh; min-height: 0; border: 0; border-radius: 0; }
  html.chat-fullscreen, html.chat-fullscreen body { overflow: hidden; overscroll-behavior: none; }
  .chat-back { display: grid; }
  .chat-top .group-avatar { display: none; }
  .bubble { max-width: 85%; }
  .chat-jump { bottom: 5.5rem; }
  .chat-container + .group-privacy, .chat-container .group-privacy { padding: 0 1.25rem; }
  .alert-toasts { left: 1rem; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); max-width: none; }
}

.msg-quote-gone { font-style: italic; color: var(--ink-soft); }
.group-rules { white-space: pre-wrap; padding: .75rem 1rem; margin: .25rem 0 1rem; background: var(--stone); border-left: 4px solid var(--ds3-teal); border-radius: 6px; }
