/*
 * FYN Member Portal. Theme fonts and colors (docs/02-build-spec.md § Portal
 * UI); layout after the Figma design. Extra Small Design.
 */
:root {
	--esd-fyn-navy: #000058;
	--esd-fyn-primary: #0077a3; /* The theme's #0089BB, darkened for text contrast: 5.0:1 on white (Kyle, 2026-10-17). */
	--esd-fyn-text: #00142c;
	--esd-fyn-muted: #6d7782;
	--esd-fyn-help: #777;
	--esd-fyn-tint: #eef7fe;
	--esd-fyn-border: #d0e0ec;
	--esd-fyn-alert: #cc4b37;
	--esd-fyn-white: #fff;
}

*, *::before, *::after { box-sizing: border-box; }

body.esd-fyn-portal {
	margin: 0;
	background: var(--esd-fyn-white);
	color: var(--esd-fyn-text);
	font: 16px/1.6 'Inter', sans-serif;
	-webkit-font-smoothing: antialiased;
	/* Sticky footer: on a short page (sign-in) the footer sits at the bottom of the window, not under the content. */
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.esd-fyn-portal h1,
.esd-fyn-portal h2,
.esd-fyn-portal h3 {
	font-family: 'IBM Plex Serif', serif;
	font-weight: normal;
	line-height: 1.2;
	margin: 0 0 0.5em;
}

.esd-fyn-portal h1 { color: var(--esd-fyn-navy); font-size: clamp(32px, 4vw, 43px); }

.esd-fyn-wrap {
	max-width: 1190px;
	margin: 0 auto;
	padding: 0 16px;
}

.esd-fyn-identity-bar {
	background: var(--esd-fyn-navy);
	color: var(--esd-fyn-white);
	min-height: 44px;
}

.esd-fyn-identity-bar .esd-fyn-wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 44px;
}

.esd-fyn-identity-bar__who { margin: 0; font-weight: 600; }
.esd-fyn-identity-bar__who .esd-fyn-icon { margin-right: 8px; }

.esd-fyn-icon {
	display: inline-block;
	width: 1em;
	height: 1em;
	vertical-align: -0.125em;
	overflow: visible;
}

.esd-fyn-link-button {
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	font: 700 14px/1 'DM Sans', sans-serif;
	letter-spacing: 1px;
	text-transform: uppercase;
	padding: 8px 0;
}

.esd-fyn-header { background: var(--esd-fyn-tint); padding: 32px 0; }
.esd-fyn-header__brand { display: flex; flex-direction: column; margin: 0; }
.esd-fyn-header__brand img { max-width: 100%; height: auto; }

.esd-fyn-main { flex: 1 0 auto; padding: 32px 0 64px; }

.esd-fyn-card {
	border: 1px solid var(--esd-fyn-border);
	border-radius: 4px;
	padding: clamp(20px, 4vw, 40px);
}

.esd-fyn-card--narrow { max-width: 640px; }

.esd-fyn-note { color: var(--esd-fyn-help); font-style: italic; font-size: 14px; }

.esd-fyn-alert {
	border-left: 4px solid var(--esd-fyn-alert);
	background: #fdf3f1;
	padding: 12px 16px;
}

.esd-fyn-button {
	display: inline-block;
	background: var(--esd-fyn-primary);
	border: 1px solid var(--esd-fyn-primary);
	border-radius: 40px;
	color: var(--esd-fyn-white);
	cursor: pointer;
	font: 700 15px/1 'DM Sans', sans-serif;
	letter-spacing: 1px;
	padding: 14px 28px;
	text-decoration: none;
	text-transform: uppercase;
}

.esd-fyn-button--outline { background: transparent; color: var(--esd-fyn-primary); }

.esd-fyn-button:focus-visible,
.esd-fyn-link-button:focus-visible {
	outline: 3px solid var(--esd-fyn-primary);
	outline-offset: 2px;
}

.esd-fyn-footer { background: var(--esd-fyn-navy); padding: 32px 0; }
.esd-fyn-footer img { max-width: 100%; height: auto; }

/* The help link, on the navy footer. Underlined so it reads as a link without colour alone. */
.esd-fyn-footer__help { margin: 16px 0 0; font-size: 15px; }
.esd-fyn-footer__help a,
.esd-fyn-footer__help a:visited { color: var(--esd-fyn-white); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.esd-fyn-footer__help a:hover { text-decoration: none; }
.esd-fyn-footer__help a:focus-visible { outline: 3px solid var(--esd-fyn-white); outline-offset: 2px; }

/* Links in running text: the sign-in note's help link and the help page.
   Navy and underlined, so they read as links in body text. */
.esd-fyn-note a,
.esd-fyn-note a:visited,
.esd-fyn-help a,
.esd-fyn-help a:visited { color: var(--esd-fyn-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.esd-fyn-note a:hover,
.esd-fyn-help a:hover { color: var(--esd-fyn-primary); }
.esd-fyn-note a:focus-visible,
.esd-fyn-help a:focus-visible { outline: 3px solid var(--esd-fyn-primary); outline-offset: 2px; }

/* The local identity-harness banner is fixed to the bottom; keep content clear of it. */
body.esd-fyn-portal:has(.esd-fyn-fixture-banner) { padding-bottom: 40px; }

/* Publication picker (step 7). */
.esd-fyn-picker { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 12px; }

.esd-fyn-picker__link {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 16px;
	align-items: center;
	border: 1px solid var(--esd-fyn-border);
	border-radius: 4px;
	padding: 16px 20px;
	color: inherit;
	text-decoration: none;
}

.esd-fyn-picker__link:hover,
.esd-fyn-picker__link:focus-visible { border-color: var(--esd-fyn-primary); background: var(--esd-fyn-tint); }
.esd-fyn-picker__link:focus-visible { outline: 3px solid var(--esd-fyn-primary); outline-offset: 2px; }

.esd-fyn-picker__name { grid-column: 1; font: 700 20px/1.3 'DM Sans', sans-serif; color: var(--esd-fyn-navy); }
.esd-fyn-picker__coverage,
.esd-fyn-picker__confirmed { grid-column: 1; font-size: 14px; color: var(--esd-fyn-muted); }
.esd-fyn-picker__confirmed--due { color: var(--esd-fyn-alert); font-weight: 600; }
.esd-fyn-picker__go { grid-column: 2; grid-row: 1 / span 3; color: var(--esd-fyn-primary); font-size: 20px; }

.esd-fyn-support { color: var(--esd-fyn-primary); font-weight: 600; }
.esd-fyn-support .esd-fyn-icon { margin-right: 4px; }

/* Editor (step 8). Read-only until the save path; the fieldset is disabled. */
.esd-fyn-back { margin: 0 0 16px; font-size: 14px; }
.esd-fyn-back a { color: var(--esd-fyn-primary); font-weight: 600; text-decoration: none; }

.esd-fyn-hero {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	background: var(--esd-fyn-tint);
	border-radius: 4px;
	padding: clamp(20px, 4vw, 32px);
}
.esd-fyn-hero h1 { margin: 0; overflow-wrap: anywhere; }

.esd-fyn-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0 0;
	border-radius: 40px;
	background: var(--esd-fyn-navy);
	color: var(--esd-fyn-white);
	font: 700 13px/1 'DM Sans', sans-serif;
	letter-spacing: 1px;
	text-transform: uppercase;
	padding: 6px 12px;
}

.esd-fyn-button:disabled { opacity: 0.45; cursor: not-allowed; }

.esd-fyn-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--esd-fyn-border); margin: 24px 0; }
.esd-fyn-tabs__tab {
	color: var(--esd-fyn-muted);
	font: 700 15px/1 'DM Sans', sans-serif;
	padding: 12px 0;
	margin-bottom: -1px;
	border-bottom: 3px solid transparent;
	text-decoration: none;
}
.esd-fyn-tabs__tab.is-current { color: var(--esd-fyn-navy); border-bottom-color: var(--esd-fyn-primary); }

.esd-fyn-notice {
	border-left: 4px solid var(--esd-fyn-primary);
	background: var(--esd-fyn-tint);
	padding: 12px 16px;
	margin: 0 0 24px;
}
.esd-fyn-notice .esd-fyn-icon { color: var(--esd-fyn-primary); margin-right: 4px; }

.esd-fyn-editor__body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; }

.esd-fyn-sections { position: sticky; top: 16px; }
.esd-fyn-sections ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--esd-fyn-border); }
.esd-fyn-sections a { display: block; padding: 6px 0 6px 14px; color: var(--esd-fyn-text); text-decoration: none; font-size: 15px; }
.esd-fyn-sections a:hover,
.esd-fyn-sections a:focus-visible { color: var(--esd-fyn-primary); }

.esd-fyn-form__fields { border: 0; margin: 0; padding: 0; min-width: 0; }

.esd-fyn-section {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 24px;
	border: 1px solid var(--esd-fyn-border);
	border-radius: 4px;
	padding: clamp(20px, 3vw, 32px);
	margin-bottom: 24px;
	scroll-margin-top: 16px;
}
.esd-fyn-section > h2,
.esd-fyn-section > .esd-fyn-help,
.esd-fyn-section > .esd-fyn-facts { grid-column: 1 / -1; }
.esd-fyn-section h2 { font-size: 26px; color: var(--esd-fyn-navy); }
.esd-fyn-section--context { background: #fafcfe; }

.esd-fyn-field { margin-bottom: 20px; min-width: 0; }
.esd-fyn-field--wide { grid-column: 1 / -1; }

.esd-fyn-field label,
.esd-fyn-label { display: block; margin: 0 0 6px; font: 700 15px/1.3 'DM Sans', sans-serif; }

.esd-fyn-required { color: var(--esd-fyn-alert); }

.esd-fyn-field input,
.esd-fyn-field select,
.esd-fyn-field textarea {
	width: 100%;
	border: 1px solid var(--esd-fyn-border);
	border-radius: 4px;
	background: var(--esd-fyn-white);
	color: var(--esd-fyn-text);
	font: 16px/1.4 'Inter', sans-serif;
	padding: 10px 12px;
}
.esd-fyn-field textarea { resize: vertical; }
.esd-fyn-field :disabled { background: #f6f8fa; color: var(--esd-fyn-text); opacity: 1; -webkit-text-fill-color: var(--esd-fyn-text); }

.esd-fyn-help { color: var(--esd-fyn-help); font-size: 14px; margin: 6px 0 0; }
.esd-fyn-section > .esd-fyn-help { margin: -4px 0 16px; }

.esd-fyn-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.esd-fyn-facts dt { font: 700 15px/1.5 'DM Sans', sans-serif; }
.esd-fyn-facts dd { margin: 0; }

@media (max-width: 800px) {
	.esd-fyn-editor__body { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.esd-fyn-sections { position: static; margin-bottom: 24px; }
	.esd-fyn-sections ul { display: flex; flex-wrap: wrap; gap: 4px 16px; border-left: 0; }
	.esd-fyn-sections a { padding: 4px 0; }
	.esd-fyn-section { grid-template-columns: minmax(0, 1fr); }
}

/* Coverage (step 11). Without script every panel shows; with it, the scope picks one. */
.esd-fyn-section h3 { font: 700 18px/1.3 'DM Sans', sans-serif; color: var(--esd-fyn-navy); margin: 0 0 8px; }
.esd-fyn-scope-panel { border-top: 1px solid var(--esd-fyn-border); padding-top: 20px; margin-top: 4px; margin-bottom: 20px; }
.esd-fyn-scope-panel[hidden] { display: none; }
.esd-fyn-scope-panel__for { font-weight: 400; font-size: 14px; color: var(--esd-fyn-muted); }
.esd-fyn-js .esd-fyn-scope-panel__for { display: none; }
/* States show for every scope, so their note (required or optional) stays. */
.esd-fyn-states { border-top: 1px solid var(--esd-fyn-border); padding-top: 20px; margin-top: 4px; margin-bottom: 20px; }
.esd-fyn-js .esd-fyn-states .esd-fyn-scope-panel__for { display: inline; }

.esd-fyn-choices { border: 0; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.esd-fyn-choices legend { grid-column: 1 / -1; padding: 0; }
.esd-fyn-choice {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 10px;
	align-items: start;
	border: 1px solid var(--esd-fyn-border);
	border-radius: 4px;
	padding: 12px 14px;
	cursor: pointer;
}
.esd-fyn-choice:has(input:checked) { border-color: var(--esd-fyn-primary); background: var(--esd-fyn-tint); }
.esd-fyn-choice:has(input:focus-visible) { outline: 3px solid var(--esd-fyn-primary); outline-offset: 2px; }
.esd-fyn-choice input { margin: 4px 0 0; grid-row: 1 / span 2; accent-color: var(--esd-fyn-primary); }
.esd-fyn-choice__label { font: 700 15px/1.3 'DM Sans', sans-serif; }
.esd-fyn-choice__help { font-size: 14px; color: var(--esd-fyn-muted); }

.esd-fyn-map { height: 360px; border: 1px solid var(--esd-fyn-border); border-radius: 4px; margin: 12px 0 16px; z-index: 0; }
.esd-fyn-map[hidden] { display: none; }

.esd-fyn-zip-jump { margin-bottom: 16px; max-width: 360px; }
.esd-fyn-zip-jump label { display: block; margin: 0 0 6px; font: 700 15px/1.3 'DM Sans', sans-serif; }
.esd-fyn-zip-jump__row { display: flex; gap: 8px; }
.esd-fyn-zip-jump input { flex: 1; min-width: 0; border: 1px solid var(--esd-fyn-border); border-radius: 4px; font: 16px/1.4 'Inter', sans-serif; padding: 10px 12px; }
.esd-fyn-button--small { padding: 10px 18px; font-size: 13px; }

.esd-fyn-radius { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0 20px; align-items: center; }
.esd-fyn-radius__slider { width: 100%; accent-color: var(--esd-fyn-primary); margin-top: 8px; }
.esd-fyn-coords { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.esd-fyn-coords[hidden] { display: none; }

.esd-fyn-checks { border: 0; margin: 0; padding: 0; min-width: 0; }
.esd-fyn-checks legend { padding: 0; }
.esd-fyn-checks + .esd-fyn-checks { margin-top: 24px; }
.esd-fyn-checks__group { font: 700 14px/1.3 'DM Sans', sans-serif; color: var(--esd-fyn-muted); text-transform: uppercase; letter-spacing: 1px; margin: 16px 0 8px; }
.esd-fyn-checks__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; }
.esd-fyn-checks__scroll { max-height: 320px; overflow-y: auto; border: 1px solid var(--esd-fyn-border); border-radius: 4px; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
/* A choice that wraps lines up under its own text, not under the checkbox. */
.esd-fyn-checks__grid label,
.esd-fyn-checks__scroll label { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; line-height: 1.4; }
.esd-fyn-checks__grid input,
.esd-fyn-checks__scroll input { flex: none; margin: 3px 0 0; }
.esd-fyn-checks input { accent-color: var(--esd-fyn-primary); }
/* Topics run long ("Housing and unhoused communities"): three columns where four fit (Kyle, 2026-10-17). */
#esd-fyn-f-primaryissueareascovered-c .esd-fyn-checks__grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Long checklists, enhanced by portal-checklist.js: chips for what is checked, a filter, a shorter list. */
.esd-fyn-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.esd-fyn-checklist [hidden] { display: none !important; }
/* State groups for countries a National or Global listing did not choose (portal-coverage.js). */
.esd-fyn-off-country { display: none !important; }
.esd-fyn-checklist__chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.esd-fyn-checklist__chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--esd-fyn-primary); border-radius: 999px; background: var(--esd-fyn-white); color: var(--esd-fyn-text); font: inherit; font-size: 14px; line-height: 1.3; cursor: pointer; }
.esd-fyn-checklist__chip .esd-fyn-icon { width: 10px; height: 12px; color: var(--esd-fyn-primary); }
.esd-fyn-checklist__chip:hover { background: var(--esd-fyn-primary); color: var(--esd-fyn-white); }
.esd-fyn-checklist__chip:hover .esd-fyn-icon { color: var(--esd-fyn-white); }
.esd-fyn-checklist__chip:focus-visible { outline: 3px solid var(--esd-fyn-primary); outline-offset: 2px; }
.esd-fyn-checklist__search { position: relative; margin: 12px 0 0; max-width: 420px; }
.esd-fyn-checklist__search .esd-fyn-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--esd-fyn-muted); pointer-events: none; }
.esd-fyn-checklist__search input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 8px 12px 8px 38px; border: 1px solid var(--esd-fyn-border); border-radius: 4px; font: inherit; }
.esd-fyn-checklist__search input:focus-visible { outline: 3px solid var(--esd-fyn-primary); outline-offset: 1px; }
.esd-fyn-checklist__status { margin: 6px 0 0; font-size: 14px; color: var(--esd-fyn-muted); }
.esd-fyn-checklist__list { max-height: 320px; overflow-y: auto; border: 1px solid var(--esd-fyn-border); border-radius: 4px; padding: 4px 14px 12px; margin-top: 10px; }
.esd-fyn-checklist__list > .esd-fyn-checks__group:first-child { margin-top: 8px; }
.esd-fyn-checklist .esd-fyn-checks__scroll.esd-fyn-checklist__list { padding: 12px 14px; }

.esd-fyn-coverage__detail { border-top: 1px solid var(--esd-fyn-border); padding-top: 20px; }

@media (max-width: 800px) {
	.esd-fyn-radius,
	.esd-fyn-coords { grid-template-columns: minmax(0, 1fr); }
	.esd-fyn-map { height: 300px; }
}

/* Audit history (step 12a). */
.esd-fyn-history h2 { font-size: 26px; color: var(--esd-fyn-navy); }
.esd-fyn-change { border: 1px solid var(--esd-fyn-border); border-radius: 4px; margin: 16px 0; overflow: hidden; }
.esd-fyn-change__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; background: #fafcfe; border-bottom: 1px solid var(--esd-fyn-border); padding: 12px 16px; }
.esd-fyn-change__head p { margin: 0; }
.esd-fyn-change__when { font: 700 15px/1.3 'DM Sans', sans-serif; }
.esd-fyn-change__who { color: var(--esd-fyn-muted); overflow-wrap: anywhere; }
.esd-fyn-change__result { margin-left: auto !important; color: #2e7d32; font-weight: 600; font-size: 14px; }
.esd-fyn-change__result--failed { color: var(--esd-fyn-alert); }
.esd-fyn-change__fields { width: 100%; border-collapse: collapse; font-size: 15px; table-layout: fixed; }
.esd-fyn-change__fields th,
.esd-fyn-change__fields td { text-align: left; vertical-align: top; padding: 10px 16px; border-top: 1px solid var(--esd-fyn-border); overflow-wrap: anywhere; }
.esd-fyn-change__fields thead th { border-top: 0; font: 700 13px/1.3 'DM Sans', sans-serif; color: var(--esd-fyn-muted); text-transform: uppercase; letter-spacing: 1px; }
.esd-fyn-change__fields tbody th { font-weight: 600; width: 28%; }

@media (max-width: 600px) {
	.esd-fyn-change__fields thead { display: none; }
	.esd-fyn-change__fields tr { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--esd-fyn-border); }
	.esd-fyn-change__fields tbody th { grid-column: 1 / -1; width: auto; padding-bottom: 0; }
	.esd-fyn-change__fields th,
	.esd-fyn-change__fields td { border-top: 0; }
	.esd-fyn-change__fields td:nth-of-type(1)::before { content: 'Before: '; color: var(--esd-fyn-muted); }
	.esd-fyn-change__fields td:nth-of-type(2)::before { content: 'After: '; color: var(--esd-fyn-muted); }
}

/* Save (step 10): notices, the error summary, inline errors. */
.esd-fyn-notice--saved { border-left-color: #2e7d32; background: #eef8ef; }
.esd-fyn-notice--saved .esd-fyn-icon { color: #2e7d32; }
.esd-fyn-summary { margin: 0 0 24px; }
.esd-fyn-summary:focus { outline: 3px solid var(--esd-fyn-alert); outline-offset: 2px; }
.esd-fyn-summary p { margin: 0 0 8px; }
.esd-fyn-summary ul { margin: 0; padding-left: 20px; }
.esd-fyn-summary a { color: var(--esd-fyn-alert); font-weight: 600; }
.esd-fyn-error { color: var(--esd-fyn-alert); font-weight: 600; font-size: 14px; margin: 6px 0 0; }
.esd-fyn-field--invalid input,
.esd-fyn-field--invalid select,
.esd-fyn-field--invalid textarea { border-color: var(--esd-fyn-alert); border-width: 2px; }
.esd-fyn-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 32px; }
.esd-fyn-button.is-busy { opacity: 0.6; cursor: progress; }

/* Logo (rc.4): the current logo, kept to a modest size on a light frame. */
.esd-fyn-logo__current img { display: block; max-width: 240px; max-height: 120px; width: auto; height: auto; padding: 8px; border: 1px solid var(--esd-fyn-border); border-radius: 4px; background: var(--esd-fyn-white); }
.esd-fyn-logo input[type="file"] { display: block; margin: 4px 0 8px; font-size: 15px; }

/* The topic cap (portal-checklist.js): boxes past it, and a count over it after a change. */
.esd-fyn-checks__off { opacity: 0.45; cursor: not-allowed; }
.esd-fyn-limit--over { color: var(--esd-fyn-alert); font-weight: 600; }

