/*
 * DGLP Platform dashboard.
 *
 * The tokens (palette, type, geometry, rhythm) live in tokens.css, which
 * Assets::style() loads before this file and before public.css. They used to
 * be declared here as well, and this copy loaded second, so a token changed in
 * tokens.css changed the public pages and left the member area exactly as it
 * was. One definition now, and it is not this one.
 *
 * Every colour reads from the custom properties Blocksy already emits on the
 * page, with the live palette hex as a fallback. Source of the fallback
 * values: wp option get theme_mods_blocksy-child. The status chip pairs are
 * asserted against WCAG AA in tests/test-brand.php, and bin/check-contrast.mjs
 * walks the rendered pages to catch the pairs a palette test cannot see.
 */

/* ---- Status chips -------------------------------------------------------
 * Backgrounds are the source palette colour mixed 88% into white; text is that
 * colour darkened until it clears 4.5:1. Measured ratios are in the comments
 * and asserted in the test suite.
 * ------------------------------------------------------------------------- */

.dgl-chip {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: max(0.72em, 12px); /* Never below 12px however deep the em nesting. */
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}

.dgl-chip--draft    { background: #e4e6e6; color: #1e3232; } /* 10.76:1 */
.dgl-chip--pending  { background: #fff7e8; color: #6b4f18; } /*  7.1:1 */
.dgl-chip--live     { background: #eaf4e6; color: #2a5a1a; } /*  7.2:1 */
.dgl-chip--changes  { background: #f9e0ea; color: #94003c; } /*  7.3:1 */
.dgl-chip--expired  { background: #e6e7ed; color: #2d3b6b; } /*  8.73:1 */
.dgl-chip--archived { background: #ebedf5; color: #3f4b7a; } /*  7.2:1 */
.dgl-chip--rejected { background: #ffede7; color: #88361b; } /*  7.1:1 */

/* ---- Primitives --------------------------------------------------------- */

/*
 * The default link colour, deliberately at the lowest specificity there is.
 *
 * Written as `.dgl-dash a` this scored 0,2,0 and beat every component rule at
 * 0,1,0. The whole sidebar navigation rendered Partnership purple on deep navy
 * at 2.13:1, and so did the active filter chip and every button that happened
 * to be an <a>. Each was the same bug wearing a different hat.
 *
 * `:where()` contributes no specificity, so this rule scores 0,0,1: any
 * component that sets its own colour wins automatically, including components
 * nobody has written yet. Fixing it here rather than raising specificity on
 * each component is what stops the next one happening.
 */
:where( .dgl-dash__main ) a {
	color: var(--dgl-link);
}

/*
 * The rule above scores 0,0,1 and the theme's own `a` rule scores the same
 * and loads later, so on staging every bare link in the content column was
 * the theme's purple. This one scores 0,1,1 for bare links only, classed
 * components keep their own colours, and the hover is pinned too because
 * the theme sets that as well.
 */
.dgl-dash__main a:where( :not( [class] ) ),
.dgl-dash__main a:where( :not( [class] ) ):hover {
	color: var(--dgl-link);
}

.dgl-dash :is(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--dgl-focus);
	outline-offset: 2px;
}

.dgl-card {
	background: var(--dgl-white);
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-card);
	padding: var(--dgl-pad-card);
	box-shadow: var(--dgl-shadow-rest);
}

.dgl-button {
	/*
	 * Every background, border and colour below is !important on purpose.
	 * Blocksy styles <button> by element, and on staging every real button
	 * in the member area, the sign-in, the join form, every decision, came
	 * out teal with white text at 2.5:1 while the links styled as buttons
	 * stayed navy. A control's colour is not the theme's to decide.
	 */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: var(--dgl-field-height);
	padding: 0 20px !important;
	border: 0 !important;
	border-radius: var(--dgl-radius-button) !important;
	background: var(--dgl-primary) !important;
	color: var(--dgl-primary-text) !important;
	font: var(--dgl-weight-button) 15px / 1 var(--dgl-font) !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none;
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color var(--dgl-motion), border-color var(--dgl-motion), color var(--dgl-motion);
}

.dgl-button:hover {
	background: color-mix(in srgb, var(--dgl-primary) 82%, #000000) !important;
	color: var(--dgl-primary-text) !important;
}

.dgl-button--secondary {
	background: transparent !important;
	border: var(--dgl-field-border) solid var(--dgl-field-outline) !important;
	color: var(--dgl-primary) !important;
}

.dgl-button--secondary:hover {
	background: var(--dgl-surface) !important;
	color: var(--dgl-primary) !important;
}

@media (prefers-reduced-motion: reduce) {
	.dgl-dash *,
	.dgl-dash *::before,
	.dgl-dash *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* ---- The document --------------------------------------------------------
 *
 * The member area renders its own page rather than sitting inside the theme's
 * header and footer, so these are the only base styles it gets. Blocksy's
 * stylesheet still loads through wp_head, which is why everything here is
 * scoped and why the body rules are stated rather than inherited. */

/*
 * The theme paints <html> too (Blocksy's is sky blue on this site), and it
 * showed as a band under the shell on a short page. Both roots are ours.
 */
html:has( body.dgl-body ) { background: var(--dgl-page) !important; }

/*
 * Stated with force, because on staging the theme still painted sky blue
 * beneath a short page after the rule above. Whatever the theme gives the
 * canvas, the member area's floor is cream to the bottom of the window.
 */
body.dgl-body { min-height: 100vh !important; background: var(--dgl-page) !important; }

/* Belt to the shell's braces: a theme footer that arrives some other way is not shown. */
body.dgl-body > footer,
body.dgl-body .ct-footer,
body.dgl-body footer#footer { display: none !important; }

body.dgl-body {
	display: flex;
	flex-direction: column;
	margin: 0;
	min-height: 100vh;
	background: var(--dgl-page);
	color: var(--dgl-text);
	font-family: var(--dgl-font);
	font-size: var(--dgl-size);
	line-height: var(--dgl-line);
	-webkit-font-smoothing: antialiased;
}

.dgl-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	padding: 12px 20px;
	background: var(--dgl-primary);
	color: var(--dgl-primary-text);
	z-index: 100;
}

.dgl-skip:focus {
	left: 0;
}

/* ---- Top bar ------------------------------------------------------------- */

.dgl-topbar {
	background: var(--dgl-white);
	border-bottom: 1px solid var(--dgl-border);
}

.dgl-topbar__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	align-items: center;
	justify-content: space-between;
	max-width: 1400px;
	margin: 0 auto;
	padding: 12px 24px;
}

.dgl-topbar__brand {
	display: flex;
	gap: 14px;
	align-items: center;
	text-decoration: none;
	color: inherit;
}

.dgl-topbar__logo {
	display: block;
	height: 40px;
	width: auto;
}

.dgl-topbar__label {
	padding-inline-start: 14px;
	border-inline-start: 1px solid var(--dgl-border);
	color: var(--dgl-text-muted);
	font-size: 0.82em;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.dgl-topbar__end {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	align-items: center;
}

.dgl-topbar__link {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	color: var(--dgl-text);
	font-size: 0.86em;
	font-weight: 500;
	text-decoration: none;
}

.dgl-topbar__link:hover { text-decoration: underline; }

.dgl-topbar__link--back { color: var(--dgl-link); }

.dgl-topbar__badge {
	min-width: 20px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--dgl-danger);
	color: #fff;
	font-size: 0.76em;
	font-weight: 700;
	text-align: center;
}

/* ---- Layout -------------------------------------------------------------- */

.dgl-dash__layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 0;
	/*
	 * The shell fills the window. The layout is the body's flexible child,
	 * so on a short page the sidebar runs to the bottom of the viewport
	 * rather than stopping where the content did, with cream underneath.
	 */
	flex: 1 0 auto;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	box-sizing: border-box;
}

.dgl-dash {
	display: flex;
	flex: 1 0 auto;
}

/*
 * One column when there is no navigation to put in the other one. Without
 * this, <main> takes the sidebar's 260px and the content column stands empty.
 */
.dgl-dash__layout--solo {
	grid-template-columns: minmax(0, 1fr);
	max-width: 760px;
	padding: 0 var(--dgl-gap);
}

.dgl-dash__sidebar {
	display: flex;
	flex-direction: column;
	gap: var(--dgl-gap-lg);
	padding: var(--dgl-gap-lg);
	background: var(--dgl-sidebar);
	color: var(--dgl-on-dark);
}

/*
 * The sidebar is a <details> element so the phone layout needs no JavaScript.
 * On a wide screen it is forced open and its summary is hidden, so the marker
 * and the toggle behaviour never appear where they are not wanted.
 */
.dgl-dash__menu-toggle { display: none; }

.dgl-dash__brand {
	display: block;
	max-width: 180px;
}

.dgl-dash__logo {
	display: block;
	height: auto;
	max-width: 100%;
}

.dgl-nav__heading {
	margin: var(--dgl-gap-lg) 0 8px;
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--dgl-on-dark-muted);
}

.dgl-nav__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dgl-nav__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 9px 12px;
	border-radius: var(--dgl-radius-button);
	font-size: 0.88em;
	font-weight: 500;
	color: var(--dgl-on-dark-body);
	text-decoration: none;
	transition: background-color var(--dgl-motion), color var(--dgl-motion);
}

.dgl-nav__item:hover {
	background: var(--dgl-on-dark-fill);
	color: var(--dgl-on-dark);
}

/* The current item is the filled one. No rail: the fill and the weight say it. */
.dgl-nav__item--active {
	background: rgba(255, 255, 255, 0.14);
	color: var(--dgl-on-dark);
	font-weight: 600;
}

.dgl-nav__count {
	font-size: 0.86em;
	font-weight: 600;
	color: var(--dgl-on-dark-muted);
}

.dgl-dash__account {
	margin-top: auto;
	padding-top: var(--dgl-gap);
	border-top: 1px solid var(--dgl-on-dark-line);
	font-size: 0.84em;
}

.dgl-dash__account-name { margin: 0; font-weight: 600; color: var(--dgl-on-dark); }
.dgl-dash__account-org  { margin: 2px 0 0; color: var(--dgl-on-dark-muted); }

/*
 * A button, because it does something. As a bare link it sat under the name
 * looking like a caption, and the person who wanted to leave had to guess
 * that it was the way out.
 */
.dgl-dash__signout {
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	margin-top: 16px; /* On the button, not the line above it, so an account with no organisation line gets the same air. */
	min-height: 44px;
	padding: 6px 16px;
	border: 2px solid var(--dgl-on-dark-muted);
	border-radius: var(--dgl-radius-button);
	color: var(--dgl-on-dark);
	font-weight: var(--dgl-weight-button);
	text-decoration: none;
}

.dgl-dash__signout:hover,
.dgl-dash__signout:focus-visible {
	background: var(--dgl-white);
	border-color: var(--dgl-white);
	color: var(--dgl-sidebar);
}

.dgl-dash__main {
	/*
	 * A grid item's minimum width is its content's, so a wide table inside
	 * <main> widened the whole column and the page scrolled sideways on a
	 * phone, however the table itself was told to scroll. min-width: 0 lets
	 * the column be the viewport and the table do the scrolling.
	 */
	min-width: 0;
	padding: var(--dgl-gap-lg) clamp(16px, 4vw, 40px) 48px;
	background: var(--dgl-page);
}

/* ---- Page furniture ------------------------------------------------------ */

.dgl-page-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--dgl-gap);
	margin-bottom: var(--dgl-gap-lg);
}

.dgl-page-head__title {
	margin: 0 0 6px;
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	font-weight: var(--dgl-weight-heading);
	line-height: 1.2;
	color: var(--dgl-navy);
}

.dgl-page-head__lede {
	margin: 0;
	max-width: 62ch;
	font-size: 0.9em;
	color: var(--dgl-text-muted);
}

.dgl-crumbs {
	margin: 0 0 6px;
	font-size: 0.76em;
	color: var(--dgl-text-muted);
}

.dgl-banner {
	margin-bottom: var(--dgl-gap-lg);
	padding: 14px 18px;
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-field);
	background: var(--dgl-surface);
	font-size: 0.86em;
}

.dgl-banner strong { display: block; color: var(--dgl-navy); }

.dgl-empty {
	margin: 0;
	padding: 28px;
	border: 1px dashed var(--dgl-border);
	border-radius: var(--dgl-radius-card);
	color: var(--dgl-text-muted);
	font-size: 0.88em;
	text-align: center;
}

/* ---- Stats --------------------------------------------------------------- */

.dgl-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: var(--dgl-gap);
	margin: 0 0 var(--dgl-gap-lg);
	padding: 0;
	list-style: none;
}

/* Each tile is a link that filters the list below, so it behaves like one:
 * block, no underline, and a visible state when it is the active filter. */
.dgl-stat {
	display: block;
	padding: 16px 18px;
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-card);
	background: var(--dgl-white);
	color: inherit;
	text-decoration: none;
	box-shadow: var(--dgl-shadow-rest);
	transition: box-shadow var(--dgl-motion), border-color var(--dgl-motion);
}

.dgl-stat:hover {
	border-color: var(--dgl-border-strong);
	box-shadow: var(--dgl-shadow-raise);
}

.dgl-stat--on {
	border-color: var(--dgl-primary);
	box-shadow: inset 0 0 0 1px var(--dgl-primary);
}

.dgl-stat--attention { border-color: var(--dgl-danger); }

.dgl-stat__label {
	display: block;
	font-size: 0.68em;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dgl-text-muted);
}

.dgl-stat--attention .dgl-stat__label { color: var(--dgl-danger); }

.dgl-stat__value {
	display: block;
	margin-top: 4px;
	font-size: 1.7em;
	font-weight: var(--dgl-weight-heading);
	color: var(--dgl-navy);
}

/* ---- Sections and tiles -------------------------------------------------- */

.dgl-section { margin-top: 40px; }

.dgl-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: var(--dgl-gap);
}

.dgl-section__title {
	margin: 0;
	font-size: 1.05em;
	font-weight: var(--dgl-weight-heading);
	color: var(--dgl-navy);
}

.dgl-section__note { margin: 0; font-size: 0.78em; color: var(--dgl-text-muted); }

/* Five content types. At full width they sit on one row; below that they wrap
 * evenly rather than leaving one stranded on a line of its own. */
.dgl-tiles {
	display: grid;
	/* 150px, not 178px: at the content width this sits in, 178 fitted four and
	 * stranded Volunteering alone on a second row, which reads as a mistake. */
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: var(--dgl-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.dgl-tile {
	display: flex;
	flex-direction: column;
	gap: 6px;
	height: 100%;
	padding: 18px 20px;
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-card);
	background: var(--dgl-white);
	text-decoration: none;
	box-shadow: var(--dgl-shadow-rest);
	transition: box-shadow var(--dgl-motion), border-color var(--dgl-motion);
}

.dgl-tile:hover { border-color: var(--dgl-border-strong); box-shadow: var(--dgl-shadow-raise); }

.dgl-tile__label { font-weight: var(--dgl-weight-heading); color: var(--dgl-navy); }
.dgl-tile__blurb { font-size: 0.82em; color: var(--dgl-text-muted); }

.dgl-tile__cta {
	margin-top: auto;
	padding-top: 10px;
	font-size: 0.8em;
	font-weight: 600;
	color: var(--dgl-link);
}

/* ---- Filters ------------------------------------------------------------- */

.dgl-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: var(--dgl-gap);
}

.dgl-filter {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 5px 14px;
	border: 1px solid var(--dgl-border);
	border-radius: 999px;
	background: var(--dgl-white);
	font-size: 0.78em;
	color: var(--dgl-text);
	text-decoration: none;
}

.dgl-filter--on {
	background: var(--dgl-navy);
	border-color: var(--dgl-navy);
	color: var(--dgl-white);
}

.dgl-filter__count { opacity: 0.7; }

/* ---- Table --------------------------------------------------------------- */

.dgl-table {
	/*
	 * A positioning context, so a visually hidden header ("Actions", for
	 * screen readers) that WordPress positions absolutely stays inside the
	 * table's scroll box. Without it the 1px span sat at its static position
	 * beyond the viewport and the whole page scrolled sideways on a phone.
	 */
	position: relative;
	width: 100%;
	border-collapse: collapse;
	background: var(--dgl-white);
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-card);
	overflow: hidden;
	font-size: 0.84em;
}

/*
 * Borders and backgrounds are stated in full on cells, not just the bottom
 * edge, because the theme gives every th and td a border of its own and it
 * showed as a faint column line through the header on staging.
 */
.dgl-dash__main .dgl-table :is( th, td ) {
	border: 0;
	border-bottom: 1px solid var(--dgl-border);
}

.dgl-table th {
	padding: 10px 16px;
	background: var(--dgl-surface);
	border-bottom: 1px solid var(--dgl-border);
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: start;
	color: var(--dgl-text-muted);
}

.dgl-table td {
	padding: 12px 16px;
	border-bottom: 1px solid var(--dgl-border);
	vertical-align: middle;
}

.dgl-table tr:last-child td { border-bottom: 0; }

/*
 * A four-column table does not fit a phone. Each row becomes a card: the
 * first cell is the title, the rest sit on one line under it, and an
 * action button spans the width. The header row is read out to screen
 * readers and not drawn. Nothing scrolls sideways.
 */
@media (max-width: 720px) {
	.dgl-dash__main .dgl-table {
		display: block;
		overflow: visible;
		border: 0;
		border-radius: 0;
		background: transparent;
	}

	.dgl-dash__main .dgl-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
		border: 0;
	}

	.dgl-dash__main .dgl-table tbody { display: block; }

	.dgl-dash__main .dgl-table tr {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 6px 12px;
		margin-bottom: 10px;
		padding: 12px 14px;
		background: var(--dgl-white);
		border: 1px solid var(--dgl-border);
		border-radius: var(--dgl-radius-field);
	}

	.dgl-dash__main .dgl-table td {
		display: block;
		padding: 0;
		border: 0;
	}

	.dgl-dash__main .dgl-table td:first-child {
		flex: 1 1 100%;
		font-size: 1.1em;
		font-weight: 600;
		line-height: 1.35;
	}

	.dgl-dash__main .dgl-table td:first-child a { text-decoration: none; }

	.dgl-dash__main .dgl-table td:first-child a:hover,
	.dgl-dash__main .dgl-table td:first-child a:focus { text-decoration: underline; }

	.dgl-dash__main .dgl-table .dgl-table__action {
		flex: 1 1 100%;
		margin-top: 4px;
		text-align: start;
	}

	.dgl-dash__main .dgl-table .dgl-table__action .dgl-button {
		width: 100%;
		justify-content: center;
	}
}

/* ---- Standalone notice pages --------------------------------------------- */

/* Group headings inside the join form: air above, a little below. */
.dgl-signin .dgl-form .dgl-section__title { margin: var(--dgl-gap-lg) 0 12px; }

.dgl-notice-page__ways {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: var(--dgl-gap-lg) 0 var(--dgl-gap);
}

.dgl-notice-page,
.dgl-signin {
	max-width: 460px;
	margin: 48px auto;
	padding: var(--dgl-pad-card);
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-card);
	background: var(--dgl-white);
}

.dgl-signin input[type="text"],
.dgl-signin input[type="password"] {
	width: 100%;
	min-height: var(--dgl-field-height);
	padding: 0 12px;
	border: var(--dgl-field-border) solid var(--dgl-field-outline);
	border-radius: var(--dgl-radius-field);
	font: var(--dgl-weight-body) 15px / var(--dgl-line) var(--dgl-font);
}

.dgl-signin input[type="submit"] {
	min-height: var(--dgl-field-height);
	padding: 0 20px;
	border: 0;
	border-radius: var(--dgl-radius-button);
	background: var(--dgl-primary);
	color: var(--dgl-primary-text);
	font: var(--dgl-weight-button) 15px / 1 var(--dgl-font);
	cursor: pointer;
}

.dgl-signin__foot { margin-top: var(--dgl-gap); font-size: 0.82em; }

/* ---- Narrow screens ------------------------------------------------------ */

@media (max-width: 782px) {
	.dgl-dash__layout { grid-template-columns: minmax(0, 1fr); }

	.dgl-dash__sidebar {
		flex-direction: column;
		gap: var(--dgl-gap);
		padding: 0;
	}

	/*
	 * Collapsed by default on a phone, so the page starts at the content
	 * instead of making somebody scroll past nine navigation links to reach it.
	 * The `open` attribute in the markup is what keeps it expanded on a wide
	 * screen, and this overrides it only here.
	 */
	.dgl-dash__sidebar[open] > *:not(summary) { margin-top: var(--dgl-gap); }

	.dgl-dash__menu-toggle {
		display: block;
		padding: 14px var(--dgl-gap-lg);
		color: var(--dgl-white);
		font-size: 0.9em;
		font-weight: 600;
		cursor: pointer;
		list-style: none;
	}

	.dgl-dash__menu-toggle::-webkit-details-marker { display: none; }

	.dgl-dash__menu-toggle::after {
		content: " ▾";
	}

	.dgl-dash__sidebar[open] .dgl-dash__menu-toggle::after {
		content: " ▴";
	}

	.dgl-dash__sidebar > .dgl-nav,
	.dgl-dash__sidebar > .dgl-dash__account {
		padding-inline: var(--dgl-gap-lg);
		padding-bottom: var(--dgl-gap);
	}

	.dgl-topbar__label { display: none; }

}

/* Wide screens: the disclosure is not a disclosure. */
@media (min-width: 783px) {
	.dgl-dash__sidebar > summary { display: none; }
}

/* ---- Wizard -------------------------------------------------------------- */

.dgl-wizard {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

.dgl-progress__heading {
	margin: 0 0 12px;
	font-size: 0.68em;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--dgl-text-muted);
}

.dgl-progress__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dgl-progress__step a,
.dgl-progress__step > span {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 0;
	color: var(--dgl-text-muted);
	text-decoration: none;
}

.dgl-progress__num {
	display: grid;
	place-items: center;
	flex: none;
	width: 28px;
	height: 28px;
	border: 1px solid var(--dgl-border);
	border-radius: 50%;
	font-size: 0.72em;
	font-weight: 700;
}

.dgl-progress__label { font-size: 0.82em; }

.dgl-progress__step--done .dgl-progress__num {
	background: var(--dgl-navy);
	border-color: var(--dgl-navy);
	color: var(--dgl-white);
}

.dgl-progress__step--done a { color: var(--dgl-link); }

.dgl-progress__step--current .dgl-progress__num {
	background: var(--dgl-navy);
	border-color: var(--dgl-navy);
	color: var(--dgl-white);
}

.dgl-progress__step--current > span {
	color: var(--dgl-navy);
	font-weight: 600;
}

.dgl-callout {
	margin-top: 24px;
	padding: 14px 16px;
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-field);
	background: var(--dgl-white);
	font-size: 0.78em;
	color: var(--dgl-text-muted);
}

.dgl-callout__title {
	margin: 0 0 4px;
	font-weight: 700;
	color: var(--dgl-navy);
}

.dgl-callout p { margin: 0; }

/* ---- Forms --------------------------------------------------------------- */

.dgl-form {
	padding: var(--dgl-pad-card);
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-card);
	background: var(--dgl-white);
}

.dgl-field-row {
	margin-bottom: 20px;
	border: 0;
	padding: 0;
}

.dgl-label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--dgl-text-muted);
}

.dgl-req { color: var(--dgl-danger); }

/*
 * The border is !important on purpose. The member area renders inside the
 * theme's stylesheet, and Blocksy styles every input by element and
 * attribute, which outranks a class however the cascade is ordered. On
 * staging that left the field edge at the theme's hairline grey, near
 * invisible, while every local check measured the token at 3.8:1 because the
 * test theme has no form styles of its own. The edge of a control is the
 * one thing here a theme is not allowed to decide.
 */
.dgl-dash .dgl-field {
	/* Border-box, or width: 100% plus 24px of padding overflows the card by 24px, which is what every text input was doing. */
	box-sizing: border-box;
	width: 100%;
	min-height: var(--dgl-field-height);
	padding: 0 12px;
	border: var(--dgl-field-border) solid var(--dgl-field-outline) !important;
	border-radius: var(--dgl-radius-field);
	background: var(--dgl-white);
	box-shadow: none !important;
	color: var(--dgl-text);
	font: var(--dgl-weight-body) 15px / var(--dgl-line) var(--dgl-font);
}

.dgl-field--area {
	min-height: 0;
	padding: 10px 12px;
	resize: vertical;
}

/*
 * The file control is the browser's own button and a line of text. A file
 * input ignores flex and gap, so the line-height centres it in the same 45px
 * box as every other field and the button's own margin makes the gap. The
 * button is restyled to match the secondary button so it does not look
 * borrowed.
 */
.dgl-field--file {
	padding: 0 12px 0 5px;
	height: var(--dgl-field-height);
	min-height: var(--dgl-field-height);
	line-height: calc(var(--dgl-field-height) - 2 * var(--dgl-field-border));
	font-size: 14px;
	color: var(--dgl-text-muted);
}

/*
 * The button is given a fixed height, no vertical padding and a line-height
 * equal to that height, then vertical-align: middle. With padding and the
 * theme's own line-height it sat a few pixels above the "No file chosen"
 * text on staging, where Montserrat's metrics differ from the test site's.
 */
.dgl-field--file::file-selector-button {
	box-sizing: border-box;
	height: calc(var(--dgl-field-height) - 12px);
	margin: 0 12px 0 0;
	padding: 0 12px;
	border: var(--dgl-field-border) solid var(--dgl-field-outline);
	border-radius: var(--dgl-radius-button);
	background: var(--dgl-surface);
	color: var(--dgl-primary);
	font: var(--dgl-weight-button) 14px / calc(var(--dgl-field-height) - 14px) var(--dgl-font);
	vertical-align: middle;
	cursor: pointer;
}

.dgl-field--file:hover::file-selector-button { background: var(--dgl-white); }

/*
 * One ring on focus, not two. The border turns purple and the outline sits
 * flush against it with no offset, so they read as a single 4px ring. With
 * the general focus rule's 2px offset the field showed border, gap, outline:
 * a double border, which is what a person sees when a focus style and a
 * border style are written by different rules and nobody looked.
 */
.dgl-dash .dgl-field:focus,
.dgl-dash .dgl-field:focus-visible {
	border-color: var(--dgl-focus) !important;
	outline: 2px solid var(--dgl-focus);
	outline-offset: 0;
}

.dgl-dash .dgl-field-row--error .dgl-field { border-color: var(--dgl-danger) !important; }

.dgl-help {
	margin: 6px 0 0;
	font-size: max(0.8em, 14px);
	color: var(--dgl-text-muted);
}

.dgl-error {
	margin: 6px 0 0;
	font-size: 0.78em;
	font-weight: 600;
	color: var(--dgl-danger);
}

/*
 * Several-of-a-list. A fieldset of the same .dgl-check rows, two columns
 * when there is room, one on a phone. The border is the field outline so
 * the group reads as one control, which for a screen reader it is.
 */
.dgl-choices {
	margin: 0;
	padding: 12px 14px 8px;
	border: var(--dgl-field-border) solid var(--dgl-field-outline);
	border-radius: var(--dgl-radius-field);
	background: var(--dgl-white);
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	column-gap: 16px;
	row-gap: 6px;
}

.dgl-choices > legend {
	grid-column: 1 / -1;
	padding: 0 4px;
	margin-inline-start: -4px;
}

.dgl-choices .dgl-check { margin: 0 0 4px; }

.dgl-dash .dgl-choices:focus-within {
	outline: 2px solid var(--dgl-focus);
	outline-offset: 2px;
}

/* A heading inside a long form: more air above than below, per the craft floor. */
.dgl-form .dgl-section__title--form {
	margin: 28px 0 10px;
	font-size: 1.05em;
}

.dgl-form .dgl-section__title--form:first-child { margin-top: 0; }

/* The repeat control: a tick box, then its parts indented under it. */
.dgl-repeat { margin: 0 0 18px; padding: 0; border: 0; }
.dgl-repeat > .dgl-check { margin-bottom: 8px; }
.dgl-repeat__body {
	margin-top: 8px;
	padding: 14px 16px 2px;
	border: var(--dgl-field-border) solid var(--dgl-border);
	border-radius: var(--dgl-radius-field);
	background: var(--dgl-surface);
}
.dgl-repeat__body .dgl-field-row { margin-bottom: 14px; }
.dgl-repeat__days { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.dgl-repeat__monthly { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; }

.dgl-check {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 0.86em;
	cursor: pointer;
}

/*
 * The box sits on the label's first line, not above it. A native checkbox is
 * 13px with its own font and margin, so in a flex row it floated up to the
 * top of a 25px line box. It is given a size, the label's font so the em is
 * the label's, and a top margin that centres it on that first line; a label
 * that wraps or carries a help line keeps the box on its first line rather
 * than drifting to the middle. accent-color keeps it Council Navy rather
 * than the browser's blue, which is the one colour that means "chosen" here.
 */
.dgl-check > input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: calc( ( 1em * var(--dgl-line) - 18px ) / 2 ) 0 0;
	font-size: inherit;
	accent-color: var(--dgl-primary);
}

.dgl-checks {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	margin-top: 8px;
}

.dgl-image-preview {
	display: block;
	max-width: 240px;
	height: auto;
	border-radius: var(--dgl-radius-field);
}

.dgl-image-current {
	margin-bottom: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* A form that holds nothing but the actions has no rule to sit under. */
.dgl-schedule { margin-bottom: var(--dgl-gap-lg); }

.dgl-schedule__extend {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	padding: 14px 16px;
	margin: 12px 0 18px;
	border: var(--dgl-field-border) solid var(--dgl-border);
	border-radius: var(--dgl-radius-field);
	background: var(--dgl-surface);
}

.dgl-schedule__extend p { margin: 0; }

.dgl-schedule__form .dgl-form__actions--alone { margin-top: 8px; }

.dgl-cancel__state { margin: 0 0 8px; }

.dgl-cancel__date { margin-bottom: var(--dgl-gap); padding-bottom: var(--dgl-gap); border-bottom: 1px solid var(--dgl-border); }

.dgl-cancel__dateslabel {
	margin: var(--dgl-gap) 0 4px;
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--dgl-text-muted);
}

.dgl-cancel__dates { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }

.dgl-cancel__dates li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }

.dgl-extend__lead { font-size: 1.05rem; }

.dgl-form__actions.dgl-form__actions--alone {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.dgl-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--dgl-gap);
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid var(--dgl-border);
}

.dgl-form__actions-end {
	display: flex;
	align-items: center;
	gap: var(--dgl-gap);
}

.dgl-linkish {
	display: inline-flex;
	align-items: center;
	min-height: 24px; /* WCAG 2.5.8: a target is at least 24px, even a text-shaped one. */
	border: 0 !important;
	background: none !important;
	padding: 2px 0 !important;
	font: 500 0.86em var(--dgl-font) !important;
	color: var(--dgl-link) !important;
	border-radius: 0 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	text-decoration: underline;
	cursor: pointer;
	box-shadow: none !important;
}

/* ---- Alerts -------------------------------------------------------------- */

.dgl-alert {
	margin-bottom: var(--dgl-gap-lg);
	padding: 14px 18px;
	border: 1px solid var(--dgl-danger);
	border-radius: var(--dgl-radius-field);
	background: #f9e0ea;
	color: #8a0038;
	font-size: 0.86em;
}

.dgl-alert--good {
	border-color: #387923;
	background: #eaf4e6;
	color: #2f6a1d;
}

.dgl-alert p { margin: 0 0 6px; }

.dgl-alert__list {
	margin: 6px 0 0;
	padding-inline-start: 20px;
}

.dgl-alert__list a { font-weight: 600; }
.dgl-alert ul { margin: 0; padding-inline-start: 20px; }
.dgl-alert a { color: inherit; }

/* ---- Review and detail --------------------------------------------------- */

.dgl-review__group {
	margin-bottom: var(--dgl-gap-lg);
	padding: 20px 22px;
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-card);
	background: var(--dgl-white);
}

.dgl-review__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.dgl-review__list {
	display: grid;
	grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
	gap: 8px 20px;
	margin: 0;
	font-size: 0.86em;
}

.dgl-review__list dt { color: var(--dgl-text-muted); }
.dgl-review__list dd { margin: 0; }
.dgl-review__list dd > :first-child { margin-top: 0; }
.dgl-review__list dd > :last-child { margin-bottom: 0; }

.dgl-review__missing { color: var(--dgl-danger); font-weight: 600; }
.dgl-review__blank   { color: var(--dgl-text-muted); }

.dgl-detail {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: var(--dgl-gap-lg);
	align-items: start;
}

.dgl-detail__status { margin: 0 0 8px; }

/* Cards stacked in the main column keep the same breathing room as the side. */
.dgl-detail > div > .dgl-card + .dgl-card { margin-top: var(--dgl-gap); }

.dgl-card {
	padding: 20px 22px;
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-card);
	background: var(--dgl-white);
	box-shadow: var(--dgl-shadow-rest);
}

.dgl-card .dgl-section__title { margin-bottom: 14px; }

/*
 * Cards stacked down a page get air between them. Scoped to <main>'s own
 * children: inside a grid the gap does that job, and a margin on top of it
 * would put the review screen's side column out of step.
 */
.dgl-dash__main > .dgl-card + .dgl-card { margin-top: var(--dgl-gap-lg); }

/* A card that introduces a form and then shows it: the form is a box of its
 * own, and the sentence above it was touching its top edge. */
.dgl-card > .dgl-form { margin-top: var(--dgl-gap); }
.dgl-card > .dgl-table + .dgl-help { margin-top: 12px; }

.dgl-timeline {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dgl-timeline__item {
	position: relative;
	padding: 0 0 18px 18px;
	border-inline-start: 1px solid var(--dgl-border);
	font-size: 0.82em;
}

.dgl-timeline__item::before {
	content: "";
	position: absolute;
	inset-inline-start: -5px;
	top: 4px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--dgl-purple);
}

.dgl-timeline__item:last-child { border-inline-start-color: transparent; padding-bottom: 0; }

.dgl-timeline__action { margin: 0; font-weight: 600; color: var(--dgl-navy); }
.dgl-timeline__when   { margin: 2px 0 0; color: var(--dgl-text-muted); }
.dgl-timeline__note   { margin: 6px 0 0; }

@media (max-width: 860px) {
	.dgl-wizard,
	.dgl-detail { grid-template-columns: minmax(0, 1fr); }

	/*
	 * On a phone the four-row progress list and the callout pushed the
	 * step's heading below the fold. The list becomes one row of numbers
	 * with only the current step named, and the callout waits for the
	 * review step, which is where "nothing goes live automatically" is
	 * the thing somebody needs to read before pressing the button.
	 */
	.dgl-progress__heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.dgl-progress__list { display: flex; align-items: center; gap: 4px; }
	.dgl-progress__step a,
	.dgl-progress__step > span { padding: 4px 0; gap: 8px; }
	.dgl-progress__step:not(.dgl-progress__step--current) .dgl-progress__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.dgl-progress__step--current { flex: 1 1 auto; min-width: 0; }
	.dgl-progress__step--current .dgl-progress__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.dgl-progress .dgl-callout { display: none; }
	.dgl-wizard--review .dgl-progress .dgl-callout { display: block; }

	.dgl-review__list { grid-template-columns: minmax(0, 1fr); gap: 2px; }
	.dgl-review__list dd { margin-bottom: 10px; }
}

/* ---- Progressive enhancement --------------------------------------------- */

.dgl-counter {
	margin: 6px 0 0;
	font-size: 0.74em;
	color: var(--dgl-text-muted);
}

.dgl-counter--low { color: var(--dgl-danger); font-weight: 600; }

.dgl-button.is-working { opacity: 0.6; cursor: progress; }

/* The editor is WordPress's own, so it only needs boxing in to match. */
.dgl-editor .wp-editor-container {
	border: var(--dgl-field-border) solid var(--dgl-field-outline);
	border-radius: var(--dgl-radius-field);
	overflow: hidden;
}

.dgl-editor .mce-toolbar-grp,
.dgl-editor .quicktags-toolbar {
	background: var(--dgl-surface);
	border-bottom: 1px solid var(--dgl-border);
}

.dgl-editor .wp-editor-area { border: 0; }

/* ---- Moderator review ---------------------------------------------------- */

.dgl-review-side {
	display: flex;
	flex-direction: column;
	gap: var(--dgl-gap);
}

.dgl-review-side .dgl-card + .dgl-card { margin-top: 0; }

.dgl-queue-nav {
	display: flex;
	align-items: center;
	gap: 10px;
}

.dgl-queue-nav__count {
	font-size: 0.8em;
	color: var(--dgl-text-muted);
}

.dgl-preview__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--dgl-radius-field);
	margin-bottom: var(--dgl-gap);
}

.dgl-preview__eyebrow {
	margin: 0 0 6px;
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--dgl-navy);
}

.dgl-preview__title {
	margin: 0 0 8px;
	font-size: 1.35em;
	font-weight: var(--dgl-weight-heading);
	line-height: 1.25;
	color: var(--dgl-navy);
}

.dgl-preview__summary {
	margin: 0 0 14px;
	font-size: 0.94em;
	color: var(--dgl-text-muted);
}

.dgl-preview__body { font-size: 0.92em; }
.dgl-preview__body p { margin: 0 0 12px; }

.dgl-preview__topics {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 14px 0 0;
}

.dgl-checks-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dgl-check-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 2px 10px;
	padding: 10px 0;
	border-bottom: 1px solid var(--dgl-border);
	font-size: 0.82em;
}

.dgl-check-row:last-child { border-bottom: 0; }

.dgl-check-row__label { font-weight: 600; color: var(--dgl-navy); }

.dgl-check-row__verdict {
	justify-self: end;
	padding: 1px 9px;
	border-radius: 999px;
	font-size: 0.86em;
	font-weight: 600;
}

.dgl-check-row__detail {
	grid-column: 1 / -1;
	color: var(--dgl-text-muted);
}

/* The same measured pairs as the status chips, reused rather than reinvented. */
.dgl-check-row--pass    .dgl-check-row__verdict { background: #eaf4e6; color: #2a5a1a; }
.dgl-check-row--warn    .dgl-check-row__verdict { background: #fff7e8; color: #6b4f18; }
.dgl-check-row--fail    .dgl-check-row__verdict { background: #f9e0ea; color: #94003c; }
.dgl-check-row--unknown .dgl-check-row__verdict { background: #e4e6e6; color: #1e3232; }

.dgl-form--bare {
	padding: 0;
	border: 0;
	background: none;
}

.dgl-decision__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}

.dgl-decision__actions .dgl-button { width: 100%; }

.dgl-button--danger {
	background: transparent !important;
	border: var(--dgl-field-border) solid var(--dgl-danger) !important;
	color: var(--dgl-danger) !important;
}

.dgl-button--danger:hover {
	background: var(--dgl-danger) !important;
	color: var(--dgl-white) !important;
}

/* A definition list in the narrow review sidebar wants stacking, not columns. */
.dgl-review-side .dgl-review__list {
	grid-template-columns: minmax(0, 1fr);
	gap: 2px;
}

.dgl-review-side .dgl-review__list dd { margin-bottom: 10px; }
.dgl-review-side .dgl-review__list dd:last-child { margin-bottom: 0; }

/* ---- Pending edits -------------------------------------------------------
 *
 * An edit to published content is a state members find genuinely worrying:
 * their listing is live, they have changed it, and they want to know whether
 * they have just taken it down. So the edit is announced in its own banner
 * above the published version rather than replacing it, and every one of these
 * says out loud that the live version is untouched.
 *
 * Amber, not red. Nothing has gone wrong. */

.dgl-alert--edit {
	border-color: #7a5a1c;
	background: #fff7e8;
	color: #6b4f18;
}

.dgl-alert--warn {
	border-color: #7a5a1c;
	background: #fff7e8;
	color: #6b4f18;
}

.dgl-alert__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-top: 10px;
}

.dgl-alert__actions:empty { display: none; }

.dgl-inline-form { display: inline; margin: 0; }

.dgl-button--small {
	padding: 7px 14px !important;
	font-size: 0.82em !important;
}

.dgl-button--quiet {
	background: transparent !important;
	border: 1px solid currentColor !important;
	color: inherit !important;
}

.dgl-button--quiet:hover {
	background: rgb(0 0 0 / 6%) !important;
	color: inherit !important;
}

/* The "Edit" marker beside a type in a list. */
.dgl-edit-flag {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 2px 7px;
	border-radius: 999px;
	background: #fff7e8;
	color: #6b4f18; /* 7.1:1 on the amber tint. Was #7a5a1c at 6.0:1, AA but short of AAA. */
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.02em;
	vertical-align: middle;
}

/* ---- The comparison ------------------------------------------------------ */

.dgl-changes__lede {
	margin: -6px 0 18px;
	color: var(--dgl-text-muted);
	font-size: 0.86em;
}

.dgl-changes__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dgl-change + .dgl-change {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid var(--dgl-border);
}

.dgl-change__label {
	margin: 0 0 10px;
	font-weight: 600;
}

/* Two columns side by side where there is room, stacked on a phone. Stacked is
 * not a worse reading: before above after is how a person reads a change
 * anyway, and it is why the captions are there rather than relying on order. */
.dgl-change__pair {
	display: grid;
	gap: 12px;
	grid-template-columns: 1fr;
}

@media (min-width: 720px) {
	.dgl-change__pair { grid-template-columns: 1fr 1fr; }
}

.dgl-change__side {
	padding: 12px 14px;
	border-radius: var(--dgl-radius-field);
	background: var(--dgl-surface);
}

.dgl-change__side--before {
	/* Struck through would be unreadable on a long description, so the old
	 * version is simply muted and captioned. */
	color: var(--dgl-text-muted);
}

.dgl-change__side--after {
	background: #eaf4e6;
	color: var(--dgl-ink);
}

.dgl-change__cap {
	margin: 0 0 6px;
	font-size: 0.74em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.8;
}

.dgl-change__value { overflow-wrap: anywhere; }
.dgl-change__value img { max-width: 120px; height: auto; border-radius: var(--dgl-radius-button); }

/* ---- Profile tabs --------------------------------------------------------
 *
 * Five groups that have nothing to do with each other. One long form would
 * make somebody changing a phone number scroll past their colleagues' accounts
 * to find it. Real links, not JavaScript panels, so each tab is its own URL and
 * a browser back button does what people expect. */

.dgl-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: var(--dgl-gap-lg);
	border-bottom: 1px solid var(--dgl-border);
}

.dgl-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-bottom: 3px solid transparent;
	color: var(--dgl-text-muted);
	font-size: 0.9em;
	font-weight: 500;
	text-decoration: none;
	/* The border sits on the container's line, not below it. */
	margin-bottom: -1px;
}

.dgl-tab:hover {
	color: var(--dgl-text);
	background: var(--dgl-surface);
}

/*
 * The open tab is a filled navy block, not an underline. A 3px line under
 * navy text on a cream page was the whole signal, and at a glance there was
 * no signal: five words in a row, one slightly heavier. Fill plus weight plus
 * aria-current is the state told three ways, none of them colour alone.
 */
.dgl-tab--on,
.dgl-tab--on:hover {
	background: var(--dgl-primary);
	border-bottom-color: var(--dgl-primary);
	border-radius: var(--dgl-radius-button) var(--dgl-radius-button) 0 0;
	color: var(--dgl-primary-text);
	font-weight: 700;
}

.dgl-tab__count {
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--dgl-surface);
	color: var(--dgl-text-muted);
	font-size: 0.8em;
	font-weight: 600;
}

.dgl-tab--on .dgl-tab__count {
	background: var(--dgl-white);
	color: var(--dgl-primary);
}

/* A field whose change waits for the review team. Sits under the control it
 * belongs to, pulled up against it so it reads as part of that field. */
.dgl-help--gated {
	margin-top: -14px;
	margin-bottom: 18px;
	font-style: italic;
}

/* ---- Pager --------------------------------------------------------------- */

.dgl-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-top: var(--dgl-gap-lg);
}

.dgl-pager__count { margin: 0; color: var(--dgl-text-muted); font-size: 0.86em; }

.dgl-pager__links {
	display: flex;
	gap: 12px;
	align-items: center;
	margin: 0;
}

.dgl-pager__where { color: var(--dgl-text-muted); font-size: 0.86em; }

/* ---- Notifications feed --------------------------------------------------
 *
 * The audit trail, read back to the member. Tone is carried by a rail down the
 * left rather than by colouring the text, so the text itself stays at full
 * contrast and colour is never the only signal — every row says what happened
 * in words. */

.dgl-feed {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dgl-feed__item {
	padding: 14px 18px;
	margin-bottom: 10px;
	border: 1px solid var(--dgl-border);
	border-radius: var(--dgl-radius-field);
	background: var(--dgl-white);
}

/* No coloured rail per tone: the first words of each item already say what happened. */

.dgl-feed__what {
	margin: 0 0 2px;
	font-weight: 600;
}

.dgl-feed__subject { margin: 0 0 6px; }

.dgl-feed__note {
	margin: 0 0 6px;
	padding: 8px 12px;
	border-radius: var(--dgl-radius-field);
	background: var(--dgl-surface);
	font-size: 0.9em;
}

.dgl-feed__when {
	margin: 0;
	color: var(--dgl-text-muted);
	font-size: 0.8em;
}

/*
 * A group of radios inside the field-row convention. The row's own border and
 * height are for a single control, so a fieldset holding two choices needs
 * neither.
 */
.dgl-field-row--group {
	border: 0;
	padding: 0;
	margin: 0 0 var(--dgl-gap);
	min-height: 0;
}

.dgl-field-row--group .dgl-check + .dgl-check { margin-top: 10px; }

.dgl-field-row--group .dgl-check .dgl-help { margin: 2px 0 0; }

/*
 * Organisations, for the review team. The search sits above the table; the
 * trust form is a master switch with its sub-switches indented under it,
 * hidden by the dependency script until the master is on.
 */
.dgl-orgsearch { margin-bottom: var(--dgl-gap); }

.dgl-orgsearch__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.dgl-orgsearch__row .dgl-field { flex: 1 1 220px; max-width: 420px; }

.dgl-orgs__name { font-weight: 600; }

.dgl-orgs__num { text-align: right; }

.dgl-orgs__trust { white-space: nowrap; }

.dgl-orgs__trust .dgl-help { white-space: normal; }

/* On a phone the header row is hidden, so a bare count needs its word. */
@media (max-width: 720px) {
	.dgl-dash__main .dgl-orgs__num::after { content: " " attr(data-noun); }
}

.dgl-orgs td .dgl-help,
.dgl-orgs td .dgl-chip { display: inline-block; margin-left: 6px; }

.dgl-trust .dgl-check > span { display: flex; flex-direction: column; gap: 2px; }

.dgl-trust__sub {
	margin-left: 27px;
	padding-left: 14px;
	border-left: 3px solid var(--dgl-border);
}

.dgl-trust__sub > legend { margin-bottom: 8px; }

.dgl-trust__sub[hidden] { display: none; }

/*
 * The organisation's full profile form, folded. The whole thing is a long
 * page on its own, and the team open it only when they mean to edit.
 */
.dgl-fold__summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--dgl-navy);
	min-height: 28px;
	padding: 6px 0;
}

.dgl-fold__summary:focus-visible { outline: 2px solid var(--dgl-primary); outline-offset: 2px; }

.dgl-fold[open] > .dgl-fold__summary { margin-bottom: 10px; }

/*
 * Joining: which organisation. The intent radios carry a bold line and a
 * help line each; the matched organisations sit indented under theirs.
 */
.dgl-intent .dgl-check > span { display: block; }
.dgl-intent .dgl-check > span > .dgl-help { display: block; margin: 2px 0 0; }
.dgl-intent__sub { margin: 8px 0 4px 27px; }
.dgl-intent__sub .dgl-check + .dgl-check { margin-top: 6px; }

.dgl-join__block { margin: 0 0 var(--dgl-gap-lg); }
.dgl-join__block[hidden] { display: none; }
.dgl-join__block > .dgl-section__title { margin-top: 0; }
.dgl-join__block > .dgl-section__title + .dgl-help { margin: -6px 0 var(--dgl-gap); }
.dgl-join__blocked .dgl-alert__actions { margin: 10px 0; }
.dgl-join__blocked .dgl-help { margin: 0; color: inherit; }

.dgl-field--short { max-width: 12ch; }

/*
 * The picker: a search box over a long select. The list opens under the
 * box, up to eight names, the active one in Council Navy like a chosen
 * row anywhere else. The chosen line replaces the box until "Change".
 */
.dgl-picker { position: relative; }

.dgl-picker__list {
	position: absolute;
	z-index: 20;
	inset-inline: 0;
	margin: 4px 0 0;
	padding: 6px 0;
	list-style: none;
	background: var(--dgl-white);
	border: 1px solid var(--dgl-border-strong);
	border-radius: var(--dgl-radius-field);
	box-shadow: var(--dgl-shadow-raise);
	max-height: 320px;
	overflow-y: auto;
}

.dgl-picker__list[hidden] { display: none; }

.dgl-picker__option,
.dgl-picker__none {
	margin: 0;
	padding: 9px 14px;
	font-size: 0.92em;
	line-height: 1.4;
}

.dgl-picker__option { cursor: pointer; color: var(--dgl-text); }

.dgl-picker__option:hover,
.dgl-picker__option.is-active {
	background: var(--dgl-primary);
	color: var(--dgl-primary-text);
}

.dgl-picker__option--pending::after {
	content: "";
}

.dgl-picker__none { color: var(--dgl-text-muted); }

.dgl-picker__chosen {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 0;
	padding: 10px 14px;
	border: var(--dgl-field-border) solid var(--dgl-field-outline);
	border-radius: var(--dgl-radius-field);
	background: var(--dgl-surface);
	font-size: 0.92em;
	font-weight: 600;
	color: var(--dgl-navy);
}

.dgl-picker__chosen[hidden] { display: none; }

.dgl-picker__change {
	border: 0;
	padding: 0;
	background: none;
	font: inherit;
	font-weight: 500;
	color: var(--dgl-link);
	text-decoration: underline;
	cursor: pointer;
}

.dgl-picker__change:focus-visible { outline: 2px solid var(--dgl-focus); outline-offset: 2px; }

/*
 * "Is it one of these?" and the team's likely matches. One row per
 * organisation: name, why it matched, and the button that takes it.
 */
.dgl-matches {
	margin: 0 0 var(--dgl-gap-lg);
	padding: 16px 18px;
	border: 1px solid #7a5a1c;
	border-radius: var(--dgl-radius-field);
	background: #fff7e8;
	color: #4d3a12;
}

.dgl-matches__title { margin: 0 0 6px; font-size: 1.05em; color: inherit; }
.dgl-matches > p { margin: 0 0 12px; font-size: 0.92em; }

.dgl-matches__list {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.dgl-match {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 10px 0;
	border-top: 1px solid rgb(122 90 28 / 30%);
}

.dgl-match:last-child { border-bottom: 1px solid rgb(122 90 28 / 30%); }

.dgl-match__who { font-size: 0.92em; }
.dgl-match__who > strong { color: var(--dgl-navy); }
.dgl-match__who > strong a { color: inherit; }
.dgl-match__why,
.dgl-match__status { display: inline-block; margin-left: 8px; font-size: 0.9em; color: #6b4f18; }
.dgl-match__status::before { content: "\2022  "; }
.dgl-match--trashed .dgl-match__who > strong { color: var(--dgl-text-muted); text-decoration: line-through; }
.dgl-match--hard .dgl-match__why { font-weight: 600; }

.dgl-matches .dgl-button--secondary { background: var(--dgl-white); }

.dgl-matches--live > .dgl-button--secondary { margin-top: 4px; }

/* The team's attach form. */
.dgl-attach .dgl-check { margin: 0 0 12px; }

/* Buttons sitting side by side in a table cell, each in its own form. */
.dgl-row-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.dgl-row-actions form { margin: 0; }

/* ---- Load more on scroll ------------------------------------------------
 *
 * The pager stays in the markup for anybody without JavaScript. With it, the
 * script hides a pager marked "hide" and adds one button that scrolling
 * presses on the reader's behalf. */

.dgl-js [data-dgl-pager="hide"] { display: none; }

.dgl-more { margin-top: var(--dgl-gap-lg); text-align: center; }

.dgl-more__sentinel { height: 1px; }

.dgl-more__button {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border: var(--dgl-field-border) solid var(--dgl-field-outline);
	border-radius: var(--dgl-radius-button);
	background: var(--dgl-white);
	color: var(--dgl-link);
	font: inherit;
	font-weight: var(--dgl-weight-button);
	cursor: pointer;
}

.dgl-more__button:hover,
.dgl-more__button:focus { background: var(--dgl-surface); }

.dgl-more__button[disabled] { cursor: progress; opacity: 0.7; }

.dgl-more__status { margin: 10px 0 0; color: var(--dgl-text-muted); font-size: 0.9em; }

.dgl-more__status:empty { display: none; }

.dgl-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;
}

.dgl-table__action { text-align: right; white-space: nowrap; }

/* ---- Phones and touch ---------------------------------------------------
 *
 * The least confident member posts from a phone. Every control they can
 * press is at least 44px tall there, the top bar is one line, and the
 * wizard's footer stacks so "Continue" is the full-width thing under the
 * thumb. Sized by pointer where it is about touch, by width where it is
 * about room. */

/* Real phones report a coarse pointer; a narrow window is treated the same so a
 * desktop browser shrunk to phone width (and the test harness) sees what a phone sees. */
@media (pointer: coarse), (max-width: 782px) {
	.dgl-check { min-height: 44px; align-items: center; padding: 2px 0; }
	.dgl-check > input { width: 22px; height: 22px; margin: 0; }
	.dgl-filter { min-height: 44px; }
	.dgl-linkish { min-height: 44px; padding: 8px 0 !important; }
	.dgl-crumbs a { display: inline-block; padding: 10px 0; }
	.dgl-progress__step a, .dgl-progress__step > span { min-height: 44px; }
	.dgl-review__head a { display: inline-block; padding: 10px 0; }
	.dgl-topbar__link { min-height: 44px; }
	.dgl-topbar__brand { min-height: 44px; }
	.dgl-progress__step a { padding-right: 8px; }
	/* In a list card the title is the way in, so it is a whole-width, thumb-sized target. */
	.dgl-dash__main .dgl-table td:first-child a { display: flex; align-items: center; min-height: 44px; }
	.dgl-feed__subject a { display: inline-flex; align-items: center; min-height: 44px; }
	.dgl-signin input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--dgl-navy); }
	.dgl-signin label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
	.dgl-signin p a { display: inline-block; padding: 8px 0; }
}

@media (max-width: 782px) {
	/* One line: the brand and the way out. Notifications, the name and
	 * Sign out are all in the menu below, so the bar does not repeat them. */
	.dgl-topbar__inner { flex-wrap: nowrap; gap: 12px; padding: 6px 16px; }
	.dgl-topbar__end { flex-wrap: nowrap; gap: 0; }
	.dgl-topbar__end .dgl-topbar__link:not(.dgl-topbar__link--back) { display: none; }
	.dgl-topbar__link--back { min-height: 44px; }

	.dgl-stat__label { font-size: max(0.72em, 13px); }
	.dgl-progress__heading { font-size: max(0.72em, 13px); }
	.dgl-edit-flag { font-size: max(0.7em, 12px); }
	.dgl-counter { font-size: max(0.78em, 14px); }
}

@media (max-width: 600px) {
	/* The wizard footer: Continue full width and first under the thumb,
	 * Back and Save and close on one row beneath it. */
	.dgl-form__actions { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
	.dgl-form__actions-end { display: flex; flex-direction: column-reverse; gap: 12px; align-items: stretch; }
	.dgl-form__actions-end .dgl-button { width: 100%; justify-content: center; }
	.dgl-form__actions-end .dgl-linkish { justify-content: center; }
	.dgl-form__actions > .dgl-button--secondary { width: 100%; justify-content: center; }
	.dgl-decision__actions .dgl-button { width: 100%; justify-content: center; }
}

/* ---- Help guides -------------------------------------------------------- */

.dgl-help-guide { display: grid; gap: var(--dgl-gap); max-width: 760px; }

.dgl-help-guide__contents-label {
	margin: 0 0 6px;
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--dgl-text-muted);
}

.dgl-help-guide__contents ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: var(--dgl-gap); }

.dgl-help-guide__contents li { break-inside: avoid; margin: 0 0 4px; }

.dgl-help-guide__section p,
.dgl-help-guide__section li { line-height: 1.55; }

.dgl-help-guide__section p { margin: 0 0 12px; }

.dgl-help-guide__list { margin: 0 0 12px; padding-left: 1.3em; }

.dgl-help-guide__list li { margin: 0 0 6px; }

.dgl-help-guide__sub { margin: 18px 0 6px; font-size: 1.02em; font-weight: 600; color: var(--dgl-navy); }

.dgl-help-guide__faq { padding: 10px 0; border-top: 1px solid var(--dgl-border); }

.dgl-help-guide__faq:last-child { padding-bottom: 0; }

.dgl-help-guide__faq summary { cursor: pointer; font-weight: 600; color: var(--dgl-navy); min-height: 28px; }

.dgl-help-guide__faq[open] summary { margin-bottom: 6px; }

.dgl-help-guide__faq p { margin: 0; }

@media ( max-width: 560px ) {
	.dgl-help-guide__contents ol { columns: 1; }
}

/* ---- Reports ------------------------------------------------------------ */

.dgl-reports__pick { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }

.dgl-reports__pick .dgl-label { margin: 0 0 4px; }

.dgl-reports__pick .dgl-field { min-width: 180px; }

.dgl-reports__month { margin: 0 0 var(--dgl-gap); }

.dgl-stat--still { cursor: default; }

.dgl-reports__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--dgl-gap); }

.dgl-reports__table { width: 100%; border-collapse: collapse; font-size: 0.95em; }

.dgl-reports__table th,
.dgl-reports__table td { padding: 7px 0; border-bottom: 1px solid var(--dgl-border); text-align: left; vertical-align: top; }

.dgl-reports__table th { font-weight: 500; color: var(--dgl-text); }

.dgl-reports__table td { width: 4em; text-align: right; font-weight: 600; color: var(--dgl-navy); white-space: nowrap; }

.dgl-reports__table tr:last-child th,
.dgl-reports__table tr:last-child td { border-bottom: 0; }

.dgl-reports__sub { margin: 16px 0 6px; font-size: 0.95em; font-weight: 600; color: var(--dgl-navy); }

.dgl-reports__downloads { margin: 0; padding-left: 1.2em; }

.dgl-reports__downloads li { margin: 0 0 6px; }

@media ( max-width: 560px ) {
	.dgl-reports__pick { width: 100%; }
	.dgl-reports__pick .dgl-field { flex: 1 1 auto; }
}

/* ---- Team notes ---------------------------------------------------------- */

.dgl-notes__list { margin: 0 0 var(--dgl-gap); padding: 0; list-style: none; display: grid; gap: 10px; }

.dgl-notes__note { padding: 10px 12px; border-left: 3px solid var(--dgl-navy); background: var(--dgl-surface); border-radius: 0 var(--dgl-radius-button) var(--dgl-radius-button) 0; }

.dgl-notes__text { margin: 0 0 4px; white-space: pre-wrap; }

.dgl-notes__meta { margin: 0; font-size: 0.85em; color: var(--dgl-text-muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }

.dgl-note-flag {
	display: inline-block;
	margin-inline-start: 6px;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--dgl-surface);
	border: 1px solid var(--dgl-border);
	color: var(--dgl-navy);
	font-size: 0.78em;
	font-weight: 600;
	white-space: nowrap;
}

/* ---- Honeypot: off screen, out of the tab order, out of the accessibility tree. */

.dgl-nohoney { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.dgl-join__exists .dgl-form__actions { margin: 12px 0; }

.dgl-upload-status { margin: 6px 0 0; min-height: 1.4em; }
