/**
 * Headwaters — public styles.
 *
 * Palette carried over from the previous system, where every token was measured
 * against WCAG AA rather than eyeballed:
 *   --hw-primary #0e6ba8  5.70:1   --hw-muted #4b5563  7.56:1
 *   --hw-danger  #b91c1c  6.47:1   --hw-success #12694a 6.68:1
 *
 * The [hidden] guard is first because a previous release shipped fixed-position
 * overlays with display:flex toggled by the hidden attribute — [hidden] is only
 * a UA rule, so any author display beats it, and the result was an invisible
 * full-page layer swallowing every click.
 */

/* ─── Foundation ───────────────────────────────────────────────────────
   Every public component carries `hw-root`, so a new one inherits the design
   tokens by adding one word rather than by somebody remembering to extend a
   selector list. The first version scoped these to four class names and three
   later components got none of them — on those pages `var(--hw-ink)` resolved
   to nothing, colour fell through to the theme, and the form was unreadable. */

.hw-root {
	/* Light. Contrast measured, not eyeballed:
	   primary 5.70:1 · muted 7.56:1 · danger 6.47:1 · success 6.68:1 */
	--hw-primary: #0e6ba8;
	--hw-primary-soft: #eaf3fa;
	--hw-primary-dark: #094f7d;
	--hw-on-primary: #fff;
	--hw-danger: #b91c1c;
	--hw-danger-soft: #fef2f2;
	--hw-warn: #92400e;
	--hw-warn-soft: #fffbeb;
	--hw-success: #12694a;
	--hw-success-soft: #ecfdf5;
	--hw-ink: #1f2933;
	--hw-muted: #4b5563;
	--hw-line: #d5dae1;
	--hw-line-soft: #e8ecf1;
	--hw-surface: #fff;
	--hw-surface-2: #f6f8fa;
	--hw-field-bg: #fff;
	--hw-bg: transparent;
	--hw-shadow: 0 1px 2px rgba(17, 24, 39, .06);

	--hw-radius: 12px;
	--hw-tap: 44px;

	color-scheme: light;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: var(--hw-ink);
	/*
	 * The component paints its own page.
	 *
	 * In light mode this is transparent and the theme shows through, which is
	 * what you want. In dark mode it is not optional: the cards carry their own
	 * dark surface but the space between them — the heading, the intro line,
	 * the step tabs — sat directly on the theme's white page with light text on
	 * it. That shipped as an all-but-invisible headline.
	 */
	background: var(--hw-bg);
	max-width: 940px;
	margin: 0 auto;
	padding: 20px 16px 64px;
	box-sizing: border-box;
	-webkit-text-size-adjust: 100%;
}

/* Inheriting box-sizing is what lets width:100% and padding coexist. Themes
   set this inconsistently, so it is set here rather than assumed. */
.hw-root *, .hw-root *::before, .hw-root *::after { box-sizing: inherit; }

/*
 * Dark.
 *
 * Not a different design — the same one with the surfaces inverted and the
 * accents lifted enough to stay legible: primary #6cb8e8 is 6.4:1 on #161b22,
 * where #0e6ba8 would be 2.1:1.
 *
 * Which of the three rules below applies is the administrator's decision, set
 * in Setup and expressed as a class on <body>:
 *
 *   no class          follow the visitor's device
 *   hw-theme-light    always light, whatever the device says
 *   hw-theme-dark     always dark
 *
 * The default is light, because a chapter's website is almost always light and
 * a dark form on a light page reads as broken rather than as a preference.
 */
@media (prefers-color-scheme: dark) {
	body:not(.hw-theme-light) .hw-root {
		--hw-primary: #6cb8e8;
		--hw-primary-soft: #16324a;
		--hw-primary-dark: #9fd2f2;
		--hw-on-primary: #04121d;
		--hw-danger: #f7a6a6;
		--hw-danger-soft: #3b1717;
		--hw-warn: #f0c07a;
		--hw-warn-soft: #382a12;
		--hw-success: #7fd6ac;
		--hw-success-soft: #10362a;
		--hw-ink: #e8edf3;
		--hw-muted: #a4b0bf;
		--hw-line: #333c47;
		--hw-line-soft: #232a33;
		--hw-surface: #161b22;
		--hw-surface-2: #1c222b;
		--hw-field-bg: #0f141a;
		--hw-bg: #10151b;
		--hw-shadow: 0 1px 2px rgba(0, 0, 0, .4);

		color-scheme: dark;
	}
}

body.hw-theme-dark .hw-root {
		--hw-primary: #6cb8e8;
		--hw-primary-soft: #16324a;
		--hw-primary-dark: #9fd2f2;
		--hw-on-primary: #04121d;
		--hw-danger: #f7a6a6;
		--hw-danger-soft: #3b1717;
		--hw-warn: #f0c07a;
		--hw-warn-soft: #382a12;
		--hw-success: #7fd6ac;
		--hw-success-soft: #10362a;
		--hw-ink: #e8edf3;
		--hw-muted: #a4b0bf;
		--hw-line: #333c47;
		--hw-line-soft: #232a33;
		--hw-surface: #161b22;
		--hw-surface-2: #1c222b;
		--hw-field-bg: #0f141a;
		--hw-bg: #10151b;
		--hw-shadow: 0 1px 2px rgba(0, 0, 0, .4);

		color-scheme: dark;
}

/* An explicit per-element choice still wins, either way — the console and the
   portal set data-theme directly, and some themes set a dark class without
   setting the media preference. */
.hw-root[data-theme="light"] {
	--hw-primary: #0e6ba8; --hw-primary-soft: #eaf3fa; --hw-primary-dark: #094f7d;
	--hw-on-primary: #fff;
	--hw-danger: #b91c1c; --hw-danger-soft: #fef2f2;
	--hw-warn: #92400e; --hw-warn-soft: #fffbeb;
	--hw-success: #12694a; --hw-success-soft: #ecfdf5;
	--hw-ink: #1f2933; --hw-muted: #4b5563;
	--hw-line: #d5dae1; --hw-line-soft: #e8ecf1;
	--hw-surface: #fff; --hw-surface-2: #f6f8fa; --hw-field-bg: #fff;
	--hw-bg: transparent;
	--hw-shadow: 0 1px 2px rgba(17, 24, 39, .06);
	color-scheme: light;
}
.hw-root[data-theme="dark"] {
		--hw-primary: #6cb8e8;
		--hw-primary-soft: #16324a;
		--hw-primary-dark: #9fd2f2;
		--hw-on-primary: #04121d;
		--hw-danger: #f7a6a6;
		--hw-danger-soft: #3b1717;
		--hw-warn: #f0c07a;
		--hw-warn-soft: #382a12;
		--hw-success: #7fd6ac;
		--hw-success-soft: #10362a;
		--hw-ink: #e8edf3;
		--hw-muted: #a4b0bf;
		--hw-line: #333c47;
		--hw-line-soft: #232a33;
		--hw-surface: #161b22;
		--hw-surface-2: #1c222b;
		--hw-field-bg: #0f141a;
		--hw-bg: #10151b;
		--hw-shadow: 0 1px 2px rgba(0, 0, 0, .4);

		color-scheme: dark;
}

/*
 * The light/dark switch, on the event-day console only.
 *
 * It came off the public forms — a visitor flipping the signup form to dark on
 * a light website is not a preference anybody asked for, and it read as a
 * fault. The console is a different thing: a tool held in one hand outdoors at
 * eight in the morning, where glare and darkness are real and the person using
 * it is the one running the day. The choice lives in localStorage on their own
 * phone and affects nobody else.
 */
.hw-console .hw-themetoggle {
	position: absolute;
	top: 0;
	right: 0;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 7px 13px;
	border: 1px solid var(--hw-line);
	border-radius: 999px;
	background: var(--hw-surface);
	color: var(--hw-muted);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.hw-console .hw-themetoggle:hover { color: var(--hw-ink); border-color: var(--hw-primary); }
.hw-console .hw-themetoggle:focus-visible { outline: 3px solid var(--hw-primary); outline-offset: 2px; }
.hw-console .hw-themetoggle-icon { font-size: 14px; line-height: 1; }

/* ─── Form controls ────────────────────────────────────────────────────
   Every property a theme is likely to set is set here, including the ones
   that look redundant. Twenty Twenty-Five gives inputs their own background
   and a narrow default width; without an explicit background and width the
   result is a dark box with dark text in it, half the width of the screen. */

.hw-root input[type="text"],
.hw-root input[type="email"],
.hw-root input[type="tel"],
.hw-root input[type="url"],
.hw-root input[type="number"],
.hw-root input[type="date"],
.hw-root input[type="time"],
.hw-root input[type="search"],
.hw-root input[type="password"],
.hw-root select,
.hw-root textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: var(--hw-tap);
	margin: 0;
	padding: 11px 13px;

	font-family: inherit;
	/* 16px minimum, or iOS zooms the page when the field is focused. */
	font-size: 16px;
	line-height: 1.45;

	color: var(--hw-ink);
	background-color: var(--hw-field-bg);
	background-image: none;
	border: 1px solid var(--hw-line);
	border-radius: 10px;
	box-shadow: none;
	outline-offset: 2px;

	-webkit-appearance: none;
	appearance: none;
}

.hw-root textarea {
	min-height: 96px;
	resize: vertical;
}

/* The arrow has to be drawn back on after appearance:none, and it has to be
   drawn in the current colour or it disappears in dark mode. */
.hw-root select {
	padding-right: 38px;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
		linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 19px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

.hw-root input:focus,
.hw-root select:focus,
.hw-root textarea:focus {
	border-color: var(--hw-primary);
	outline: 3px solid var(--hw-primary);
	outline-offset: 1px;
}

.hw-root input::placeholder,
.hw-root textarea::placeholder { color: var(--hw-muted); opacity: 1; }

.hw-root input[type="checkbox"],
.hw-root input[type="radio"] {
	width: 22px;
	height: 22px;
	min-height: 0;
	accent-color: var(--hw-primary);
	-webkit-appearance: auto;
	appearance: auto;
}

.hw-root input[type="range"] { width: 100%; accent-color: var(--hw-primary); }
.hw-root input[type="file"] { max-width: 100%; font-size: 15px; }

/* Themes love to restyle these. */
.hw-root button { font-family: inherit; }
.hw-root a { color: var(--hw-primary); }

/* Headings inside a component are ours, not the theme's — Twenty Twenty-Five
   renders an h2 at 40px, which clipped the page title on a phone. */
.hw-root h1, .hw-root h2, .hw-root h3, .hw-root h4 {
	font-family: inherit;
	color: var(--hw-ink);
	line-height: 1.25;
	margin: 0 0 10px;
	letter-spacing: -0.01em;
}
.hw-root h1 { font-size: clamp(26px, 6vw, 34px); }
.hw-root h2 { font-size: clamp(22px, 5vw, 27px); }
.hw-root h3 { font-size: clamp(17px, 4vw, 19px); }
.hw-root h4 { font-size: 16px; }
.hw-root p { margin: 0 0 12px; color: var(--hw-ink); }

/* Cards and panels carry their own surface, so a theme cannot leave them
   transparent over a background of the opposite brightness. */
.hw-root .hw-fieldset,
.hw-root .hw-card,
.hw-root .hw-notice,
.hw-root .hw-callout {
	background-color: var(--hw-surface);
	color: var(--hw-ink);
}

.hw-root .hw-check input { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--hw-primary); }
.hw-check-strong { font-weight: 600; }
.hw-checks { display: flex; flex-direction: column; gap: 2px; }

.hw-fieldset { border: 1px solid var(--hw-line-soft); border-radius: var(--hw-radius); background: var(--hw-surface); padding: 20px; margin: 0 0 18px; }
.hw-fieldset legend { padding: 0 8px; font-size: 17px; font-weight: 700; }
.hw-subpanel { margin-top: 12px; padding: 16px; background: var(--hw-surface-2); border-radius: 8px; }
.hw-notice { padding: 16px 18px; border-radius: var(--hw-radius); border-left: 4px solid var(--hw-primary); background: var(--hw-surface-2); font-size: 15px; }
.hw-notice-warn { border-left-color: var(--hw-warn); background: var(--hw-warn-soft); }
.hw-callout { padding: 16px 18px; background: var(--hw-surface-2); border-left: 4px solid var(--hw-primary); border-radius: 8px; margin-bottom: 24px; }
.hw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.hw-hero { text-align: center; margin-bottom: 24px; }
.hw-hero-program { font-size: 14px; font-weight: 600; color: var(--hw-primary); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.hw-hero h2 { margin: 6px 0; font-size: 28px; }
.hw-hero-when { font-size: 17px; font-weight: 600; margin: 0; }
.hw-hero-where { font-size: 15px; color: var(--hw-muted); margin: 4px 0 0; }

.hw-waiver { max-height: 260px; overflow-y: auto; padding: 16px; background: var(--hw-surface-2); border: 1px solid var(--hw-line); border-radius: 8px; font-size: 15px; line-height: 1.7; margin-bottom: 14px; }
.hw-signature { font-family: Georgia, serif; font-style: italic; font-size: 19px !important; }
.hw-orglist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 0 16px; max-height: 280px; overflow-y: auto; padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--hw-line); border-radius: 8px; background: var(--hw-surface-2); }

/* Shifts */
.hw-shifts { display: grid; gap: 10px; }
.hw-shift { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 2px solid var(--hw-line); border-radius: var(--hw-radius); cursor: pointer; }
.hw-shift:has(input:checked) { border-color: var(--hw-primary); background: var(--hw-surface-2); }
.hw-shift.is-full { opacity: .6; }
.hw-root .hw-shift input { width: 22px; height: 22px; accent-color: var(--hw-primary); }
.hw-shift-body { display: flex; flex-direction: column; }
.hw-shift-name { font-weight: 700; font-size: 16px; }
.hw-shift-time { font-size: 14px; color: var(--hw-muted); }
.hw-shift-space { font-size: 13px; font-weight: 600; color: var(--hw-primary); }

/* Done + check-in */
.hw-done, .hw-checkin-card { text-align: center; padding: 40px 24px; background: var(--hw-surface); border: 1px solid var(--hw-line-soft); border-radius: 16px; }
.hw-done-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--hw-success-soft); color: var(--hw-success); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700; }

/* Hours */
.hw-hours-head { margin-bottom: 20px; }
.hw-hours-lifetime { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-top: 14px; }
.hw-hours-lifetime > div { text-align: center; padding: 18px 10px; background: var(--hw-surface); border: 1px solid var(--hw-line-soft); border-radius: var(--hw-radius); }
.hw-big { display: block; font-size: 30px; font-weight: 800; color: var(--hw-primary); line-height: 1.1; }
.hw-small { display: block; font-size: 13px; color: var(--hw-muted); margin-top: 2px; }
.hw-monthnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 12px; }
.hw-monthnav span { font-size: 18px; font-weight: 700; }
.hw-entry { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--hw-line-soft); border-radius: 8px; margin-bottom: 8px; background: var(--hw-surface); }
.hw-entry-date { font-weight: 700; min-width: 58px; }
.hw-entry-body { flex: 1; min-width: 0; }
.hw-entry-hours { font-weight: 800; font-size: 18px; }
.hw-pill { display: inline-flex; padding: 2px 9px; border-radius: 999px; background: var(--hw-surface-2); color: var(--hw-muted); font-size: 13px; font-weight: 600; }
.hw-pill-ok { background: var(--hw-success-soft); color: var(--hw-success); }
.hw-pill-wait { background: var(--hw-warn-soft); color: var(--hw-warn); }
.hw-addhours { margin-top: 24px; padding: 20px; border: 1px solid var(--hw-line-soft); border-radius: var(--hw-radius); background: var(--hw-surface); }

/* Event list */
.hw-eventlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hw-eventcard { display: flex; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--hw-line-soft); border-radius: var(--hw-radius); background: var(--hw-surface); }
.hw-eventcard-date { text-align: center; min-width: 56px; }
.hw-ec-day { display: block; font-size: 26px; font-weight: 800; line-height: 1; }
.hw-ec-mon { display: block; font-size: 13px; text-transform: uppercase; color: var(--hw-muted); }
.hw-eventcard-body { flex: 1; min-width: 0; }
.hw-eventcard-body h3 { margin: 2px 0; font-size: 18px; }
.hw-ec-program { font-size: 13px; color: var(--hw-primary); font-weight: 600; margin: 0; }
.hw-ec-where { font-size: 14px; color: var(--hw-muted); margin: 0; }

.hw-toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
/* Deliberately inverted against the page in both themes, so a toast reads as
   an overlay rather than as part of the form behind it. */
.hw-toast { padding: 14px 18px; border-radius: var(--hw-radius);
	background: var(--hw-ink); color: var(--hw-surface);
	font-size: 15px; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.hw-toast-warn { background: var(--hw-warn); }

@media (max-width: 600px) {
	.hw-grid-2, .hw-grid-3 { grid-template-columns: minmax(0,1fr); }
	.hw-fieldset { padding: 16px; }
	.hw-eventcard { flex-wrap: wrap; }
}

/* ─── Join wizard ──────────────────────────────────────────────────── */
.hw-join { max-width: 820px; }
.hw-join .hw-hero { margin-bottom: 22px; }
.hw-join .hw-hero h2 { margin-bottom: 6px; }
.hw-hero-when { color: var(--hw-muted); font-size: 15px; margin: 0; }
/* The step list wrapped "3. Interests" onto two lines on a phone, which made
   the row a different height from its neighbours and looked broken. Numbers
   only below 480px; the words come back when there is room for them. */
.hw-steps { list-style: none; display: flex; gap: 6px; margin: 0 0 20px; padding: 0; counter-reset: step; }
.hw-steps li { flex: 1 1 0; min-width: 0; counter-increment: step; padding: 10px 4px;
	text-align: center; font-size: 13.5px; font-weight: 600; white-space: nowrap;
	overflow: hidden; text-overflow: ellipsis;
	color: var(--hw-muted); border-bottom: 3px solid var(--hw-line); }
.hw-steps li::before { content: counter(step) ". "; }
.hw-steps li.is-active { color: var(--hw-primary); border-bottom-color: var(--hw-primary); }
.hw-steps li.is-done { color: var(--hw-success); border-bottom-color: var(--hw-success); }

@media (max-width: 480px) {
	/* Just the number and a tick — the label is what wraps. */
	.hw-steps li { font-size: 0; padding: 12px 2px; }
	.hw-steps li::before { content: counter(step); font-size: 15px; }
	.hw-steps li.is-done::before { content: "\2713"; }
}
.hw-stepnav { display: flex; gap: 10px; }
.hw-stepnav .hw-btn { flex: 1; }

/* ─── Member dashboard ─────────────────────────────────────────────── */
.hw-dashboard { max-width: 900px; }
.hw-dash-head h2 { margin: 0 0 4px; font-size: 26px; }
.hw-dash-section { margin-top: 32px; }
.hw-dash-section h3 { font-size: 18px; margin: 0 0 12px; }
.hw-yearlist, .hw-historylist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.hw-yearlist li, .hw-historylist li { display: flex; gap: 12px; align-items: center; padding: 10px 12px;
	border: 1px solid var(--hw-line-soft); border-radius: 8px; background: var(--hw-surface); }
.hw-historylist li span:first-child { flex: 1; font-weight: 600; }
.hw-sub { font-size: 13px; color: var(--hw-muted); }

/* ─── Membership offer at signup ───────────────────────────────────── */
.hw-offer .hw-radio { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 8px;
	border: 1px solid var(--hw-line); border-radius: 10px; cursor: pointer; }
.hw-offer .hw-radio:has(input:checked) { border-color: var(--hw-primary); background: var(--hw-primary-soft); }
.hw-root .hw-offer .hw-radio input { margin-top: 3px; }
.hw-offer .hw-radio strong { display: block; font-size: 15px; }
.hw-offer .hw-radio em { display: block; font-style: normal; font-size: 13px; color: var(--hw-muted); margin-top: 2px; }
.hw-offer-extra { margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--hw-line); }
.hw-offer-after { margin-top: 24px; padding: 16px; border: 1px dashed var(--hw-line); border-radius: 10px; text-align: left; }
.hw-offer-after p { margin: 0 0 10px; font-size: 14px; }

/* Profile completeness */
.hw-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.hw-progress-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--hw-line); overflow: hidden; max-width: 260px; }
.hw-progress-bar > span { display: block; height: 100%; background: var(--hw-success); border-radius: 999px; }
.hw-progress-label { font-size: 13px; color: var(--hw-muted); font-weight: 600; }

/* Never let a hidden block stay clickable — a fixed or flex element with an
   author display rule beats the UA [hidden] rule, which is how a previous
   build shipped three invisible full-screen click traps. */
.hw-join [hidden], .hw-signup [hidden], .hw-checkin [hidden], .hw-dashboard [hidden],
.hw-hours [hidden], .hw-events [hidden] { display: none !important; }

/* ─── Event console ────────────────────────────────────────────────────
   Built for a phone in a car park. Tap targets are 52px because gloves;
   the roster row is one line of name and one big button, nothing else. */
.hw-console { max-width: 780px; }
.hw-console-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
	padding-bottom: 12px; border-bottom: 2px solid var(--hw-line); }
.hw-console-head h2 { margin: 0; font-size: 22px; }

.hw-console-net { flex-shrink: 0; padding: 5px 11px; font-size: 12.5px; font-weight: 700; border-radius: 999px; }
.hw-console-net.is-offline { background: var(--hw-danger-soft); color: var(--hw-danger); }
.hw-console-net.is-pending { background: var(--hw-warn-soft); color: var(--hw-warn); }
.hw-console-expiry { margin: 10px 0 0; padding: 8px 12px; font-size: 13px;
	background: var(--hw-primary-soft); color: var(--hw-primary-dark); border-radius: 8px; }

.hw-console-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.hw-console-stat { padding: 10px 6px; text-align: center; background: var(--hw-surface);
	border: 1px solid var(--hw-line-soft); border-radius: 10px; }
.hw-console-stat b { display: block; font-size: 24px; line-height: 1.1; color: var(--hw-primary); }
.hw-console-stat span { font-size: 11.5px; color: var(--hw-muted); }

.hw-console-nav { display: flex; gap: 6px; margin-bottom: 14px; }
.hw-console-tab { flex: 1; min-height: var(--hw-tap); padding: 12px 8px; font-size: 15px; font-weight: 600;
	cursor: pointer; color: var(--hw-muted); background: transparent;
	border: 1px solid var(--hw-line); border-radius: 10px; }
.hw-console-tab.is-active { color: var(--hw-on-primary); background: var(--hw-primary); border-color: var(--hw-primary); }
.hw-console-tab:focus-visible { outline: 3px solid var(--hw-primary); outline-offset: 2px; }

.hw-console-search { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.hw-root .hw-console-search input[type="search"] { min-height: var(--hw-tap); font-size: 17px; padding: 10px 14px;
	border: 2px solid var(--hw-line); border-radius: 10px; }
.hw-console-filter { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--hw-muted); }

.hw-console-list { display: grid; gap: 8px; }
.hw-console-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
	background: var(--hw-surface); border: 1px solid var(--hw-line); border-radius: 12px; }
.hw-console-row.is-in { border-color: var(--hw-success); background: var(--hw-success-soft); }
.hw-console-row.is-out { opacity: .62; }
.hw-console-who { flex: 1; min-width: 0; }
.hw-console-who strong { font-size: 16px; }
.hw-console-ice { margin-top: 3px; font-size: 13px; color: var(--hw-muted); }
.hw-console-queued { margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--hw-warn); }
.hw-console-row .hw-btn { min-height: 52px; min-width: 116px; font-size: 15px; }

.hw-console-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.hw-root .hw-metric input { min-height: var(--hw-tap); font-size: 18px; }
.hw-root .hw-metric input.is-saved { border-color: var(--hw-success); }

@media (max-width: 480px) {
	.hw-console-stats { grid-template-columns: repeat(2, 1fr); }
}

.hw-console [hidden] { display: none !important; }

/* ─── Incident reporting ───────────────────────────────────────────────
   The emergency button is big, red and one tap. Everything about it is
   deliberate: somebody using it has a casualty in front of them. */
.hw-sos { display: block; width: 100%; padding: 18px; margin-bottom: 20px; cursor: pointer;
	/* Fixed red in both themes on purpose: this is the one control whose
	   meaning is carried by its colour, and a "dark mode red" that reads as
	   maroon is not the same signal. */
	text-align: center; color: #fff; background: #b91c1c; border: none; border-radius: 12px; }
.hw-sos strong { display: block; font-size: 21px; letter-spacing: .02em; }
.hw-sos em { display: block; font-style: normal; font-size: 13px; opacity: .92; margin-top: 4px; }
.hw-sos:active { background: #991b1b; }
.hw-sos:focus-visible { outline: 4px solid #fca5a5; outline-offset: 3px; }

.hw-console-tab-alert.has-open::after { content: ""; display: inline-block; width: 8px; height: 8px;
	margin-left: 6px; vertical-align: middle; border-radius: 50%; background: var(--hw-danger); }

.hw-console-incidents { margin-top: 24px; }
.hw-console-incidents h3 { font-size: 15px; margin: 0 0 10px; }
.hw-incident { padding: 12px 14px; margin-bottom: 8px; background: var(--hw-surface);
	border: 1px solid var(--hw-line); border-left: 4px solid var(--hw-line); border-radius: 10px; }
.hw-incident.is-critical, .hw-incident.is-high { border-left-color: var(--hw-danger); }
.hw-incident.is-medium { border-left-color: var(--hw-warn); }
.hw-incident.is-closed { opacity: .66; }
.hw-incident-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hw-incident p { margin: 6px 0 4px; font-size: 14px; }

/* ─── Partner logo wall ────────────────────────────────────────────── */
.hw-partners { margin: 32px 0; }
.hw-partners-title { font-size: 22px; margin: 0 0 16px; }
.hw-partner-grid { list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(var(--hw-partner-cols, 4), 1fr); gap: 20px; align-items: center; }
.hw-partner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.hw-partner img { max-width: 100%; height: auto; max-height: 78px; object-fit: contain;
	filter: grayscale(1); opacity: .78; transition: filter .15s ease, opacity .15s ease; }
.hw-partner:hover img { filter: none; opacity: 1; }
.hw-partner.is-featured img { max-height: 96px; filter: none; opacity: 1; }
.hw-partner-name { font-weight: 600; font-size: 15px; color: var(--hw-ink); }
.hw-partner-count { font-size: 12px; color: var(--hw-muted); }
@media (max-width: 640px) { .hw-partner-grid { grid-template-columns: repeat(2, 1fr); } }

/* ─── Gallery ──────────────────────────────────────────────────────── */
.hw-gallery { margin: 32px 0; }
.hw-gallery-title { font-size: 22px; margin: 0 0 16px; }
.hw-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.hw-gallery-item { margin: 0; overflow: hidden; border-radius: 12px; background: var(--hw-surface);
	border: 1px solid var(--hw-line-soft); }
.hw-gallery-item.is-featured { grid-column: span 2; grid-row: span 2; }
.hw-gallery-item img, .hw-gallery-item video { display: block; width: 100%; height: 100%;
	min-height: 190px; object-fit: cover; background: #111; }
.hw-gallery-item figcaption { padding: 10px 12px; font-size: 13.5px; }
.hw-gallery-caption { display: block; }
.hw-gallery-meta { display: block; margin-top: 3px; font-size: 12.5px; color: var(--hw-muted); }
@media (max-width: 560px) { .hw-gallery-item.is-featured { grid-column: span 1; grid-row: span 1; } }

/* ─── Results tiles ────────────────────────────────────────────────── */
.hw-results { margin: 32px 0; }
.hw-results-title { font-size: 22px; margin: 0 0 16px; }
.hw-results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.hw-result { padding: 20px 12px; text-align: center; border-radius: 12px; background: var(--hw-primary-soft); }
.hw-result b { display: block; font-size: 30px; line-height: 1.1; color: var(--hw-primary); }
.hw-result span { display: block; margin-top: 4px; font-size: 13px; color: var(--hw-muted); }

/* ─── Console photos ───────────────────────────────────────────────── */
.hw-photo-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px;
	margin-bottom: 16px; text-align: center; cursor: pointer;
	border: 2px dashed var(--hw-line); border-radius: 12px; background: var(--hw-surface); }
.hw-photo-drop .dashicons { font-size: 30px; width: 30px; height: 30px; color: var(--hw-primary); }
.hw-photo-drop strong { font-size: 16px; }
.hw-photo-drop em { font-style: normal; font-size: 13px; color: var(--hw-muted); }
.hw-photo-sent { margin-top: 22px; }
.hw-photo-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
	padding: 9px 12px; margin-bottom: 6px; font-size: 14px;
	border: 1px solid var(--hw-line-soft); border-radius: 8px; }

/* ─── Where: sites and directions ──────────────────────────────────── */
.hw-site-card { padding: 14px 16px; margin-bottom: 12px; background: var(--hw-surface);
	border: 1px solid var(--hw-line); border-left: 4px solid var(--hw-line); border-radius: 12px; }
.hw-site-card.is-medium { border-left-color: var(--hw-warn); }
.hw-site-card.is-high { border-left-color: var(--hw-danger); }
.hw-site-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hw-site-card-head strong { font-size: 17px; }
.hw-site-card p { margin: 8px 0 0; font-size: 14.5px; }
.hw-site-hazard { font-weight: 600; color: var(--hw-danger); }
.hw-site-directions, .hw-site-parking { padding: 9px 11px; border-radius: 8px; background: var(--hw-line-soft); }
.hw-site-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hw-site-links .hw-btn { flex: 1; min-width: 120px; min-height: var(--hw-tap); }

/* ─── News ─────────────────────────────────────────────────────────── */
.hw-console-tab-news.has-unread::after { content: ""; display: inline-block; width: 8px; height: 8px;
	margin-left: 6px; vertical-align: middle; border-radius: 50%; background: var(--hw-warn); }
.hw-news { padding: 13px 15px; margin-bottom: 10px; background: var(--hw-surface);
	border: 1px solid var(--hw-line); border-left: 4px solid var(--hw-line); border-radius: 10px; }
.hw-news.is-important { border-left-color: var(--hw-warn); background: var(--hw-warn-soft); }
.hw-news.is-urgent { border-left-color: var(--hw-danger); background: var(--hw-danger-soft); }
.hw-news.is-acked { opacity: .65; }
.hw-news p { margin: 6px 0; font-size: 15.5px; }
.hw-news .hw-btn { margin-top: 10px; min-height: var(--hw-tap); }
.hw-news-acked { margin-top: 8px; font-size: 13.5px; font-weight: 600; color: var(--hw-success); }

/* An urgent message is not something you scroll past. */
.hw-urgent { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center;
	padding: 22px; background: rgba(17, 24, 39, .82); }
.hw-urgent-panel { width: 100%; max-width: 460px; padding: 26px 24px; text-align: center;
	background: var(--hw-surface); color: var(--hw-ink);
	border-radius: 16px; border-top: 6px solid var(--hw-danger); }
.hw-urgent-panel strong { display: block; font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
	color: var(--hw-danger); }
.hw-urgent-panel p { margin: 12px 0 20px; font-size: 19px; line-height: 1.45; color: var(--hw-ink); }
.hw-site-hazard-notes { padding: 10px 12px; border-radius: 8px;
	background: var(--hw-danger-soft); color: var(--hw-danger); font-weight: 500; }



/* ─── Fieldsets and cards, restated ────────────────────────────────────
   These carry an explicit surface and border because a theme that gives
   `fieldset` a background of its own is common, and the result was white
   text on a white card. */
.hw-root .hw-fieldset {
	border: 1px solid var(--hw-line);
	border-radius: var(--hw-radius);
	background: var(--hw-surface);
	padding: 18px 18px 6px;
	margin: 0 0 18px;
	min-width: 0;
	box-shadow: var(--hw-shadow);
}
/*
 * The legend, as an ordinary heading rather than as a legend.
 *
 * A native <legend> is painted into the gap in the fieldset's top border, and
 * where it lands is decided by the browser and then argued with by the theme.
 * Twenty Twenty-Five floats it; others position it absolutely or give it a
 * transform. The result on this form was "About you" sitting astride the card's
 * top edge with its descenders clipped off.
 *
 * Taking it out of the border entirely — float:none, position:static, full
 * width, inside the padding — makes it behave like the <h2> it always was, and
 * removes the browser's and the theme's opinion from the question. The element
 * stays a <legend> because that is what names the group for a screen reader.
 */
.hw-root .hw-fieldset > legend {
	display: block;
	/*
	 * float:left, and it has to be a float.
	 *
	 * The first attempt at this used float:none;position:static, reasoning that
	 * taking the browser's opinions away would make the legend behave. It does
	 * the opposite: those *are* the defaults, and a legend at its defaults gets
	 * the special legend layout — painted into the gap in the fieldset's top
	 * border. Measured on the live site afterwards, the legend's top edge was
	 * still exactly the fieldset's top edge.
	 *
	 * Floating it is what opts out of that layout and makes it an ordinary box
	 * inside the content area. Verified in the browser, not reasoned about:
	 * 19px below the border instead of 0.
	 */
	float: left;
	position: static;
	width: 100%;
	max-width: 100%;
	padding: 0 0 14px;
	margin: 0;
	border: 0;
	background: none;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: var(--hw-ink);
	transform: none;
}

/* Whatever follows a float has to clear it. */
.hw-root .hw-fieldset > legend + * { clear: both; }
.hw-root .hw-field { margin-bottom: 16px; }
.hw-root .hw-label {
	display: block;
	margin-bottom: 6px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--hw-ink);
}
.hw-root .hw-hint { margin: 6px 0 0; font-size: 13.5px; color: var(--hw-muted); line-height: 1.5; }
.hw-root .hw-sub { font-size: 13.5px; color: var(--hw-muted); }
.hw-root .hw-req { color: var(--hw-danger); }

/* Two and three column grids collapse to one on a phone rather than
   squeezing two 140px inputs side by side. */
.hw-root .hw-grid-2,
.hw-root .hw-grid-3 { display: grid; gap: 0 16px; }
@media (min-width: 620px) {
	.hw-root .hw-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hw-root .hw-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Buttons: explicit colours both ways, and full width on a phone where a
   half-width primary action just looks like something went wrong. */
.hw-root .hw-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	min-height: var(--hw-tap); padding: 11px 20px;
	font-size: 15.5px; font-weight: 600; line-height: 1.2; text-decoration: none;
	cursor: pointer; border: 1px solid transparent; border-radius: 10px;
	transition: background-color .12s ease, border-color .12s ease;
}
.hw-root .hw-btn-primary { color: var(--hw-on-primary); background: var(--hw-primary); border-color: var(--hw-primary); }
.hw-root .hw-btn-primary:hover { background: var(--hw-primary-dark); border-color: var(--hw-primary-dark); }
.hw-root .hw-btn-ghost { color: var(--hw-ink); background: var(--hw-surface); border-color: var(--hw-line); }
.hw-root .hw-btn-ghost:hover { border-color: var(--hw-primary); color: var(--hw-primary); }
.hw-root .hw-btn-block { width: 100%; }
.hw-root .hw-btn-lg { min-height: 52px; font-size: 17px; }
.hw-root .hw-btn:disabled { opacity: .55; cursor: not-allowed; }
.hw-root .hw-btn:focus-visible { outline: 3px solid var(--hw-primary); outline-offset: 2px; }

.hw-root .hw-error {
	padding: 11px 14px; margin: 0 0 14px; font-size: 14.5px; font-weight: 600;
	color: var(--hw-danger); background: var(--hw-danger-soft);
	border-left: 4px solid var(--hw-danger); border-radius: 0 8px 8px 0;
}
.hw-root .hw-field-error { margin: 6px 0 0; font-size: 13.5px; font-weight: 600; color: var(--hw-danger); }
.hw-root .hw-empty { padding: 18px; text-align: center; color: var(--hw-muted); font-size: 14.5px; }

.hw-toprow { display: flex; justify-content: flex-end; margin-bottom: 8px; }

/* ─── Long-form pages ──────────────────────────────────────────────────
   The hero on a signup or join page is ours. A theme that renders h1 at
   48px clipped "Become a Volunteer" against the top of a phone screen. */
.hw-root .hw-hero { margin: 0 0 22px; }
.hw-root .hw-hero h1, .hw-root .hw-hero h2 { margin-bottom: 8px; }
.hw-root .hw-hero-when { font-size: 15.5px; color: var(--hw-muted); margin: 0; }
.hw-root .hw-hero-eyebrow {
	display: block; margin-bottom: 6px;
	font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: var(--hw-primary);
}

/* Notices carry their own surface both ways. */
.hw-root .hw-notice {
	padding: 14px 16px; margin: 0 0 18px; border-radius: 10px;
	border: 1px solid var(--hw-line); border-left: 4px solid var(--hw-primary);
}
.hw-root .hw-notice-warn {
	background: var(--hw-warn-soft); color: var(--hw-warn); border-color: var(--hw-warn);
}
.hw-root .hw-callout {
	padding: 14px 16px; margin: 0 0 18px; border-radius: 10px;
	background: var(--hw-surface-2); border-left: 4px solid var(--hw-primary);
	color: var(--hw-ink);
}

/* Checkboxes and radios: the row, not just the box. */
.hw-root .hw-check, .hw-root .hw-radio {
	display: flex; gap: 11px; align-items: flex-start;
	padding: 11px 13px; margin-bottom: 9px;
	border: 1px solid var(--hw-line); border-radius: 10px;
	background: var(--hw-surface); color: var(--hw-ink);
	cursor: pointer;
}
.hw-root .hw-check:has(input:checked),
.hw-root .hw-radio:has(input:checked) {
	border-color: var(--hw-primary); background: var(--hw-primary-soft);
}
.hw-root .hw-check span, .hw-root .hw-radio span { flex: 1; min-width: 0; }
.hw-root .hw-check em, .hw-root .hw-radio em {
	display: block; margin-top: 3px; font-style: normal;
	font-size: 13.5px; color: var(--hw-muted); line-height: 1.5;
}

/* Never leave a hidden element clickable — a fixed overlay with an author
   display rule beats the UA [hidden] rule, which once cost a whole portal. */
.hw-root [hidden] { display: none !important; }
