/* ---------------------------------------------------------------------------
 * GWS Work Portal — application shell and components.
 *
 * Layout follows the Design System's shared application shell:
 *   Global header · Primary navigation (sidebar) · Main content · Context panel
 *
 * Responsive intent:
 *   Small  — single column, bottom navigation, sidebar becomes a slide-over.
 *   Medium — sidebar collapses, two columns allowed selectively.
 *   Large  — persistent sidebar, multi-column dashboards.
 * ------------------------------------------------------------------------- */

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

body.gws-app {
	margin: 0;
	font-family: var(--gws-font-sans);
	font-size: var(--gws-font-size-body);
	line-height: var(--gws-line-height-body);
	color: var(--gws-text-primary);
	background: var(--gws-surface-page);
	-webkit-font-smoothing: antialiased;
}

body.gws-app a { color: var(--gws-text-link); }

/* Visible, high-contrast focus. Never removed without a replacement. */
body.gws-app :focus-visible {
	outline: 3px solid var(--gws-border-focus);
	outline-offset: 2px;
	border-radius: var(--gws-radius-sm);
}

.gws-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--gws-brand-primary);
	color: var(--gws-brand-primary-contrast);
	padding: var(--gws-space-3) var(--gws-space-4);
	z-index: 100;
}
.gws-skip-link:focus { left: var(--gws-space-4); top: var(--gws-space-4); }

/* --- Shell ---------------------------------------------------------------- */

.gws-shell {
	display: grid;
	grid-template-columns: var(--gws-sidebar-width) 1fr;
	grid-template-rows: var(--gws-header-height) 1fr;
	grid-template-areas: "sidebar header" "sidebar main";
	min-height: 100vh;
}

/* --- Header --------------------------------------------------------------- */

.gws-header {
	grid-area: header;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--gws-space-4);
	padding: 0 var(--gws-space-6);
	background: var(--gws-surface-card);
	border-bottom: 1px solid var(--gws-border-default);
	position: sticky;
	top: 0;
	z-index: 20;
}

.gws-header__title {
	font-size: var(--gws-font-size-h3);
	font-weight: var(--gws-font-weight-bold);
	margin: 0;
}

.gws-header__meta {
	display: flex;
	align-items: center;
	gap: var(--gws-space-4);
	font-size: var(--gws-font-size-label);
	color: var(--gws-text-secondary);
}

.gws-header__user { display: flex; flex-direction: column; line-height: 1.3; text-align: right; }
.gws-header__user strong { color: var(--gws-text-primary); }

.gws-menu-toggle {
	display: none;
	background: none;
	border: 1px solid var(--gws-border-strong);
	border-radius: var(--gws-radius-sm);
	padding: var(--gws-space-2) var(--gws-space-3);
	font: inherit;
	color: inherit;
	cursor: pointer;
	min-height: 40px;
}

/* --- Sidebar -------------------------------------------------------------- */

.gws-sidebar {
	grid-area: sidebar;
	background: var(--gws-surface-sidebar);
	color: var(--gws-text-inverse);
	padding: var(--gws-space-4) var(--gws-space-3);
	display: flex;
	flex-direction: column;
	gap: var(--gws-space-6);
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
}

body.gws-app a.gws-brand,
.gws-brand {
	display: flex;
	align-items: center;
	gap: var(--gws-space-3);
	padding: var(--gws-space-2) var(--gws-space-3);
	font-weight: var(--gws-font-weight-bold);
	color: var(--gws-text-inverse);
	text-decoration: none;
}

.gws-brand__mark {
	width: 32px;
	height: 32px;
	border-radius: var(--gws-radius-sm);
	background: var(--gws-brand-primary);
	display: grid;
	place-items: center;
	font-size: var(--gws-font-size-caption);
	letter-spacing: 0.04em;
}

.gws-brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.gws-brand__sub {
	font-size: var(--gws-font-size-caption);
	font-weight: 400;
	color: rgba(255, 255, 255, 0.62);
}

.gws-nav__group-label {
	font-size: var(--gws-font-size-caption);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.5);
	padding: 0 var(--gws-space-3);
	margin-bottom: var(--gws-space-2);
}

.gws-nav__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

body.gws-app a.gws-nav__link,
.gws-nav__link {
	display: flex;
	align-items: center;
	gap: var(--gws-space-3);
	padding: var(--gws-space-3);
	border-radius: var(--gws-radius-sm);
	color: rgba(255, 255, 255, 0.82);
	text-decoration: none;
	font-size: var(--gws-font-size-body);
	min-height: 42px;
	transition: background var(--gws-transition), color var(--gws-transition);
}

.gws-nav__link:hover { background: var(--gws-surface-sidebar-active); color: #fff; }

.gws-nav__link[aria-current="page"] {
	background: var(--gws-surface-sidebar-active);
	color: #fff;
	font-weight: var(--gws-font-weight-medium);
	box-shadow: inset 3px 0 0 var(--gws-brand-primary);
}

/*
 * Navigation items that are present but not yet built are marked, never
 * silently linked to nothing. The Design System forbids teasing inaccessible
 * modules, so these appear only for roles that will hold them.
 */
.gws-nav__link--pending { color: rgba(255, 255, 255, 0.42); cursor: default; }
.gws-nav__link--pending:hover { background: none; color: rgba(255, 255, 255, 0.42); }

.gws-nav__badge {
	margin-left: auto;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: var(--gws-radius-full);
	padding: 1px 7px;
}

.gws-sidebar__footer {
	margin-top: auto;
	padding-top: var(--gws-space-4);
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	font-size: var(--gws-font-size-caption);
	color: rgba(255, 255, 255, 0.55);
}

/* --- Main ----------------------------------------------------------------- */

.gws-main {
	grid-area: main;
	padding: var(--gws-space-6);
	max-width: var(--gws-content-max-width);
	width: 100%;
}

.gws-page-head { margin-bottom: var(--gws-space-6); }
.gws-page-head h1 {
	font-size: var(--gws-font-size-display);
	margin: 0 0 var(--gws-space-2);
	font-weight: var(--gws-font-weight-bold);
}
.gws-page-head p { margin: 0; color: var(--gws-text-secondary); }

/* --- Cards and grids ------------------------------------------------------ */

.gws-grid { display: grid; gap: var(--gws-space-4); }
.gws-grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.gws-grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.gws-card {
	background: var(--gws-surface-card);
	border: 1px solid var(--gws-border-default);
	border-radius: var(--gws-radius-md);
	padding: var(--gws-space-6);
	box-shadow: var(--gws-shadow-none);
}

.gws-card__title {
	font-size: var(--gws-font-size-h3);
	margin: 0 0 var(--gws-space-3);
	font-weight: var(--gws-font-weight-bold);
}

.gws-definition { margin: 0; display: grid; gap: var(--gws-space-3); }
.gws-definition div { display: flex; justify-content: space-between; gap: var(--gws-space-4); }
.gws-definition dt { color: var(--gws-text-secondary); font-size: var(--gws-font-size-label); }
.gws-definition dd { margin: 0; font-weight: var(--gws-font-weight-medium); text-align: right; word-break: break-word; }

/* --- Badges (never colour alone: each carries a text label) ---------------- */

.gws-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--gws-space-1);
	font-size: var(--gws-font-size-caption);
	font-weight: var(--gws-font-weight-medium);
	padding: 2px 10px;
	border-radius: var(--gws-radius-full);
	border: 1px solid transparent;
}
.gws-badge--info { background: var(--gws-status-info-bg); color: var(--gws-status-info); border-color: currentColor; }
.gws-badge--success { background: var(--gws-status-success-bg); color: var(--gws-status-success); border-color: currentColor; }
.gws-badge--warning { background: var(--gws-status-warning-bg); color: var(--gws-status-warning); border-color: currentColor; }
.gws-badge--danger { background: var(--gws-status-danger-bg); color: var(--gws-status-danger); border-color: currentColor; }

/* --- Buttons -------------------------------------------------------------- */

.gws-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--gws-space-2);
	min-height: 44px;
	padding: var(--gws-space-3) var(--gws-space-6);
	border-radius: var(--gws-radius-sm);
	border: 1px solid transparent;
	font: inherit;
	font-weight: var(--gws-font-weight-medium);
	cursor: pointer;
	text-decoration: none;
	transition: background var(--gws-transition), border-color var(--gws-transition);
}

/*
 * Selectors are qualified with body.gws-app so they outrank the global
 * `body.gws-app a` link colour. Without this, an anchor styled as a button
 * inherits the link colour — which on the primary variant is the same blue as
 * its own background, rendering the label invisible.
 */
body.gws-app a.gws-button--primary,
.gws-button--primary {
	background: var(--gws-brand-primary);
	color: var(--gws-brand-primary-contrast);
}
body.gws-app a.gws-button--primary:hover,
.gws-button--primary:hover { background: var(--gws-brand-primary-hover); }

body.gws-app a.gws-button--secondary,
.gws-button--secondary {
	background: var(--gws-surface-card);
	color: var(--gws-text-primary);
	border-color: var(--gws-border-strong);
}
.gws-button--block { width: 100%; }

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

.gws-field { display: grid; gap: var(--gws-space-2); margin-bottom: var(--gws-space-4); }
.gws-field label { font-size: var(--gws-font-size-label); font-weight: var(--gws-font-weight-medium); }
.gws-field input {
	width: 100%;
	min-height: 44px;
	padding: var(--gws-space-3);
	border: 1px solid var(--gws-border-strong);
	border-radius: var(--gws-radius-sm);
	background: var(--gws-surface-card);
	color: var(--gws-text-primary);
	font: inherit;
}
.gws-field__hint { font-size: var(--gws-font-size-caption); color: var(--gws-text-muted); }

/* --- Application states --------------------------------------------------- */

.gws-state {
	display: grid;
	gap: var(--gws-space-3);
	justify-items: center;
	text-align: center;
	padding: var(--gws-space-12) var(--gws-space-6);
	background: var(--gws-surface-card);
	border: 1px solid var(--gws-border-default);
	border-radius: var(--gws-radius-md);
	max-width: 560px;
	margin: 0 auto;
}
.gws-state__icon {
	width: 48px; height: 48px;
	border-radius: var(--gws-radius-full);
	display: grid; place-items: center;
	font-size: 1.25rem;
	background: var(--gws-surface-subtle);
}
.gws-state--danger .gws-state__icon { background: var(--gws-status-danger-bg); color: var(--gws-status-danger); }
.gws-state--warning .gws-state__icon { background: var(--gws-status-warning-bg); color: var(--gws-status-warning); }
.gws-state h1, .gws-state h2 { margin: 0; font-size: var(--gws-font-size-h2); }
.gws-state p { margin: 0; color: var(--gws-text-secondary); }
.gws-state__actions { display: flex; gap: var(--gws-space-3); flex-wrap: wrap; justify-content: center; margin-top: var(--gws-space-2); }
.gws-state__code {
	font-size: var(--gws-font-size-caption);
	color: var(--gws-text-muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.gws-loading {
	display: inline-block;
	width: 22px; height: 22px;
	border: 2px solid var(--gws-border-strong);
	border-top-color: var(--gws-brand-primary);
	border-radius: 50%;
	animation: gws-spin 700ms linear infinite;
}
@keyframes gws-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.gws-loading { animation-duration: 2s; }
}

/* --- Auth layout ---------------------------------------------------------- */

.gws-auth {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: var(--gws-space-6);
	background: var(--gws-surface-page);
}
.gws-auth__card {
	width: 100%;
	max-width: 400px;
	background: var(--gws-surface-card);
	border: 1px solid var(--gws-border-default);
	border-radius: var(--gws-radius-lg);
	padding: var(--gws-space-8);
	box-shadow: var(--gws-shadow-subtle);
}
.gws-auth__head { text-align: center; margin-bottom: var(--gws-space-6); }
.gws-auth__head h1 { font-size: var(--gws-font-size-h2); margin: var(--gws-space-3) 0 var(--gws-space-1); }
.gws-auth__head p { margin: 0; color: var(--gws-text-secondary); font-size: var(--gws-font-size-label); }
.gws-auth__error {
	background: var(--gws-status-danger-bg);
	color: var(--gws-status-danger);
	border: 1px solid currentColor;
	border-radius: var(--gws-radius-sm);
	padding: var(--gws-space-3);
	font-size: var(--gws-font-size-label);
	margin-bottom: var(--gws-space-4);
}
.gws-auth__foot {
	margin-top: var(--gws-space-6);
	text-align: center;
	font-size: var(--gws-font-size-caption);
	color: var(--gws-text-muted);
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1024px) {
	.gws-shell { grid-template-columns: 1fr; grid-template-areas: "header" "main"; }

	.gws-menu-toggle { display: inline-flex; align-items: center; }

	.gws-sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		width: min(84vw, var(--gws-sidebar-width));
		transform: translateX(-100%);
		transition: transform var(--gws-transition);
		z-index: 40;
	}

	body.gws-nav-open .gws-sidebar { transform: translateX(0); }

	body.gws-nav-open::after {
		content: "";
		position: fixed;
		inset: 0;
		background: var(--gws-surface-overlay);
		z-index: 30;
	}

	.gws-main { padding: var(--gws-space-4); }
}

@media (max-width: 640px) {
	.gws-card { padding: var(--gws-space-4); }
	.gws-header { padding: 0 var(--gws-space-4); }
	.gws-header__user { display: none; }
	.gws-page-head h1 { font-size: 1.375rem; }
	.gws-definition div { flex-direction: column; gap: var(--gws-space-1); }
	.gws-definition dd { text-align: left; }
}

/* ---------------------------------------------------------------------------
   Scoped record list — used by the dashboard client-account list.
   Phase 1 Step 1.
   --------------------------------------------------------------------------- */

.gws-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--gws-space-2);
}

.gws-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--gws-space-3);
	padding: var(--gws-space-3) 0;
	border-bottom: 1px solid var(--gws-border-default);
}

.gws-list li:last-child {
	border-bottom: 0;
}

.gws-list a {
	font-weight: 600;
	text-decoration: none;
	color: var(--gws-text-primary);
}

.gws-list a:hover,
.gws-list a:focus-visible {
	text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Phase 1 Step 2 — Admin portal components
   Tables, forms, filters, pagination, metrics and notices.

   Everything here uses the existing design tokens; no new colour is introduced,
   so a brand palette swap in tokens.css still reaches every one of these.
   --------------------------------------------------------------------------- */

/* Utilities ---------------------------------------------------------------- */

.gws-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

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

.gws-hint {
	color: var(--gws-text-secondary);
	font-size: var(--gws-font-size-label);
	margin: 0 0 var(--gws-space-4);
}

.gws-required { color: var(--gws-status-danger); }

.gws-rule {
	border: 0;
	border-top: 1px solid var(--gws-border-default);
	margin: var(--gws-space-6) 0 var(--gws-space-4);
}

.gws-breadcrumb {
	margin: 0 0 var(--gws-space-3);
	font-size: var(--gws-font-size-label);
}

.gws-result-count {
	color: var(--gws-text-secondary);
	font-size: var(--gws-font-size-label);
	margin: 0 0 var(--gws-space-3);
}

.gws-card--spaced { margin-top: var(--gws-space-6); }
.gws-card--form { max-width: 860px; }

.gws-card__subtitle {
	font-size: var(--gws-font-size-h3);
	font-weight: var(--gws-font-weight-bold);
	margin: 0 0 var(--gws-space-3);
}

.gws-page-head--actions {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--gws-space-4);
	flex-wrap: wrap;
}

.gws-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gws-space-3);
}

/* Notices ------------------------------------------------------------------ */

.gws-notice {
	border: 1px solid currentColor;
	border-radius: var(--gws-radius-md);
	padding: var(--gws-space-3) var(--gws-space-4);
	margin-bottom: var(--gws-space-6);
	font-size: var(--gws-font-size-body);
	font-weight: var(--gws-font-weight-medium);
}

.gws-notice--success { background: var(--gws-status-success-bg); color: var(--gws-status-success); }
.gws-notice--error { background: var(--gws-status-danger-bg); color: var(--gws-status-danger); }

/* Buttons — additional variants -------------------------------------------- */

body.gws-app a.gws-button--ghost,
.gws-button--ghost {
	background: transparent;
	color: var(--gws-text-secondary);
	border: 1px solid var(--gws-border-strong);
}

body.gws-app a.gws-button--ghost:hover,
.gws-button--ghost:hover {
	background: var(--gws-surface-subtle);
	color: var(--gws-text-primary);
}

.gws-button--small {
	padding: var(--gws-space-1) var(--gws-space-3);
	font-size: var(--gws-font-size-caption);
}

/* Fields and forms --------------------------------------------------------- */

.gws-field {
	display: flex;
	flex-direction: column;
	gap: var(--gws-space-1);
	min-width: 0;
}

.gws-field--grow { flex: 1 1 240px; }

.gws-field__label {
	font-size: var(--gws-font-size-label);
	font-weight: var(--gws-font-weight-medium);
	color: var(--gws-text-secondary);
}

.gws-field__hint {
	font-size: var(--gws-font-size-caption);
	color: var(--gws-text-muted);
}

.gws-field input,
.gws-field select,
.gws-field textarea {
	font-family: inherit;
	font-size: var(--gws-font-size-body);
	color: var(--gws-text-primary);
	background: var(--gws-surface-card);
	border: 1px solid var(--gws-border-strong);
	border-radius: var(--gws-radius-sm);
	padding: var(--gws-space-2) var(--gws-space-3);
	min-height: 40px;
	width: 100%;
}

.gws-field input:focus-visible,
.gws-field select:focus-visible,
.gws-field textarea:focus-visible {
	outline: 3px solid var(--gws-border-focus);
	outline-offset: 1px;
	border-color: var(--gws-border-focus);
}

.gws-form {
	display: grid;
	gap: var(--gws-space-4);
}

.gws-form__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: var(--gws-space-4);
}

.gws-form__actions {
	display: flex;
	gap: var(--gws-space-3);
	flex-wrap: wrap;
	align-items: center;
}

.gws-form--inline {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--gws-space-3);
}

.gws-form--tight { margin: 0; }

.gws-fieldset {
	border: 1px solid var(--gws-border-default);
	border-radius: var(--gws-radius-md);
	padding: var(--gws-space-4);
	margin: 0;
}

.gws-fieldset legend {
	font-size: var(--gws-font-size-label);
	font-weight: var(--gws-font-weight-bold);
	padding: 0 var(--gws-space-2);
}

.gws-checkbox {
	display: flex;
	align-items: center;
	gap: var(--gws-space-2);
	font-size: var(--gws-font-size-label);
	color: var(--gws-text-secondary);
}

.gws-checkbox input { width: auto; min-height: 0; }

.gws-callout {
	background: var(--gws-surface-subtle);
	border-radius: var(--gws-radius-md);
	padding: var(--gws-space-4);
	font-size: var(--gws-font-size-label);
	color: var(--gws-text-secondary);
}

.gws-callout strong { color: var(--gws-text-primary); display: block; margin-bottom: var(--gws-space-1); }
.gws-callout p { margin: 0; }

/* Toolbar ------------------------------------------------------------------ */

.gws-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--gws-space-3);
	background: var(--gws-surface-card);
	border: 1px solid var(--gws-border-default);
	border-radius: var(--gws-radius-md);
	padding: var(--gws-space-4);
	margin-bottom: var(--gws-space-4);
}

.gws-toolbar__actions {
	display: flex;
	gap: var(--gws-space-2);
	align-items: center;
}

/* Tables ------------------------------------------------------------------- */

.gws-table-wrap {
	/* Wide tables scroll inside their own container; the page never scrolls sideways. */
	overflow-x: auto;
	border: 1px solid var(--gws-border-default);
	border-radius: var(--gws-radius-md);
	background: var(--gws-surface-card);
}

.gws-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--gws-font-size-body);
}

.gws-table th,
.gws-table td {
	text-align: left;
	padding: var(--gws-space-3) var(--gws-space-4);
	border-bottom: 1px solid var(--gws-border-default);
	vertical-align: middle;
}

.gws-table thead th {
	position: sticky;
	top: 0;
	background: var(--gws-surface-subtle);
	color: var(--gws-text-secondary);
	font-size: var(--gws-font-size-label);
	font-weight: var(--gws-font-weight-bold);
	white-space: nowrap;
	z-index: 1;
}

.gws-table tbody tr:last-child td { border-bottom: 0; }
.gws-table tbody tr:hover { background: var(--gws-surface-subtle); }

/* Pagination --------------------------------------------------------------- */

.gws-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--gws-space-4);
	margin-top: var(--gws-space-4);
}

.gws-pagination__status {
	font-size: var(--gws-font-size-label);
	color: var(--gws-text-secondary);
}

/* Metrics ------------------------------------------------------------------ */

.gws-metrics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: var(--gws-space-4);
}

.gws-metric {
	display: flex;
	flex-direction: column;
	gap: var(--gws-space-1);
	background: var(--gws-surface-card);
	border: 1px solid var(--gws-border-default);
	border-radius: var(--gws-radius-md);
	padding: var(--gws-space-4);
	box-shadow: var(--gws-shadow-subtle);
	text-decoration: none;
	transition: border-color var(--gws-transition), box-shadow var(--gws-transition);
}

body.gws-app a.gws-metric { color: inherit; }

body.gws-app a.gws-metric:hover,
body.gws-app a.gws-metric:focus-visible {
	border-color: var(--gws-border-selected);
	box-shadow: var(--gws-shadow-raised);
}

.gws-metric__label {
	font-size: var(--gws-font-size-label);
	color: var(--gws-text-secondary);
	font-weight: var(--gws-font-weight-medium);
}

.gws-metric__value {
	font-size: var(--gws-font-size-display);
	font-weight: var(--gws-font-weight-bold);
	line-height: 1.1;
}

/* An unavailable metric must never look like a measured zero. */
.gws-metric--unavailable { background: var(--gws-surface-subtle); }
.gws-metric__value--none { color: var(--gws-text-muted); }

.gws-metric__hint {
	font-size: var(--gws-font-size-caption);
	color: var(--gws-text-muted);
}

.gws-metric .gws-badge { align-self: flex-start; }

/* Timeline ----------------------------------------------------------------- */

.gws-timeline {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--gws-space-2);
	font-size: var(--gws-font-size-label);
}

.gws-timeline li {
	display: flex;
	justify-content: space-between;
	gap: var(--gws-space-4);
	padding-bottom: var(--gws-space-2);
	border-bottom: 1px solid var(--gws-border-default);
	flex-wrap: wrap;
}

.gws-timeline li:last-child { border-bottom: 0; padding-bottom: 0; }

/* Mobile ------------------------------------------------------------------- */

@media (max-width: 720px) {
	/*
	 * The Design System requires that no data table forces horizontal scrolling
	 * for the primary task on mobile. Below this breakpoint the operational
	 * tables become stacked rows, each cell labelled from its data-label.
	 */
	.gws-table thead { display: none; }

	.gws-table,
	.gws-table tbody,
	.gws-table tr,
	.gws-table td {
		display: block;
		width: 100%;
	}

	.gws-table tr {
		border-bottom: 1px solid var(--gws-border-default);
		padding: var(--gws-space-2) 0;
	}

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

	.gws-table td {
		border-bottom: 0;
		display: flex;
		justify-content: space-between;
		gap: var(--gws-space-4);
		padding: var(--gws-space-2) var(--gws-space-4);
		text-align: right;
	}

	.gws-table td::before {
		content: attr(data-label);
		color: var(--gws-text-secondary);
		font-size: var(--gws-font-size-label);
		font-weight: var(--gws-font-weight-medium);
		text-align: left;
	}

	.gws-toolbar { flex-direction: column; align-items: stretch; }
	.gws-form--inline { flex-direction: column; align-items: stretch; }
	.gws-page-head--actions { flex-direction: column; }
}

/* --- Public recruitment pages --------------------------------------------- */

/*
 * The public careers experience. Same tokens as the application, different
 * chrome: no sidebar, no role, no sign-out. A candidate should recognise this
 * as GWS Work without being shown the shape of the internal product.
 */
.gws-public {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--gws-surface-page);
}
.gws-public__header {
	padding: var(--gws-space-5) var(--gws-space-6);
	border-bottom: 1px solid var(--gws-border-default);
	background: var(--gws-surface-card);
}
.gws-public__main {
	flex: 1;
	width: 100%;
	max-width: 860px;
	margin: 0 auto;
	padding: var(--gws-space-8) var(--gws-space-6);
}
.gws-public__intro { margin-bottom: var(--gws-space-6); }
.gws-public__intro h1 { font-size: var(--gws-font-size-h1); margin: 0 0 var(--gws-space-2); }
.gws-public__lead { margin: 0; color: var(--gws-text-secondary); font-size: var(--gws-font-size-body); }
.gws-public__footer {
	padding: var(--gws-space-5) var(--gws-space-6);
	border-top: 1px solid var(--gws-border-default);
	color: var(--gws-text-muted);
	font-size: var(--gws-font-size-caption);
	text-align: center;
}

.gws-opportunity-card {
	display: block;
	background: var(--gws-surface-card);
	border: 1px solid var(--gws-border-default);
	border-radius: var(--gws-radius-md);
	padding: var(--gws-space-5);
	margin-bottom: var(--gws-space-4);
	text-decoration: none;
	color: inherit;
}
.gws-opportunity-card:hover,
.gws-opportunity-card:focus-visible {
	border-color: var(--gws-border-strong, var(--gws-border-default));
	box-shadow: var(--gws-shadow-subtle);
}
.gws-opportunity-card h2 { margin: 0 0 var(--gws-space-2); font-size: var(--gws-font-size-h3); }
.gws-opportunity-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gws-space-3);
	color: var(--gws-text-secondary);
	font-size: var(--gws-font-size-label);
	margin: 0;
}

/* Long-form opportunity copy. Rendered from stored plain text, never markup. */
.gws-prose { white-space: pre-line; line-height: 1.65; }
.gws-prose + .gws-prose { margin-top: var(--gws-space-4); }

/* The honeypot. Hidden from people and from assistive technology, reachable by bots. */
.gws-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* An unassessed score. Never rendered as a zero. */
.gws-unassessed { color: var(--gws-text-muted); font-style: italic; }

/* Explanation of a workflow step the platform cannot perform yet. */
.gws-blocked {
	border-left: 3px solid var(--gws-status-warning, #b26a00);
	background: var(--gws-surface-page);
	padding: var(--gws-space-3) var(--gws-space-4);
	margin: var(--gws-space-3) 0;
	font-size: var(--gws-font-size-label);
	color: var(--gws-text-secondary);
}
.gws-blocked strong { color: var(--gws-text-primary); }

@media (max-width: 720px) {
	.gws-public__main { padding: var(--gws-space-6) var(--gws-space-4); }
}

/* Applicant outcome card. The one place a candidate is told where they stand,
   so it is given the weight of a headline rather than a row in a list. */
.gws-card--decision { border-left: 4px solid var(--gws-brand-primary); }

/* Assessor review of a candidate attempt. The internal-note variant is marked
   so it reads as recruiter-only on screen; the applicant serializer has no key
   for it, so it can never appear on a candidate's page. */
.gws-attempt { padding: var(--gws-space-3) 0; }
.gws-attempt + .gws-attempt { border-top: 1px solid var(--gws-border-default); }
.gws-prose--internal {
	border-left: 3px solid var(--gws-status-warning);
	padding-left: var(--gws-space-3);
	color: var(--gws-text-secondary);
}

/* --- Sales pipeline board (Phase 2) ------------------------------------- */

.gws-board {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(220px, 1fr);
	gap: var(--gws-space-3, 12px);
	overflow-x: auto;
	padding-bottom: var(--gws-space-3, 12px);
}

.gws-board__column {
	background: var(--gws-surface-subtle);
	border-radius: 8px;
	padding: var(--gws-space-3, 12px);
	min-height: 120px;
}

.gws-board__title {
	font-size: 0.875rem;
	margin: 0 0 var(--gws-space-2, 8px);
}

.gws-board__card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: var(--gws-space-2, 8px) var(--gws-space-3, 12px);
	margin-bottom: var(--gws-space-2, 8px);
	border: 1px solid var(--gws-border-default);
	border-radius: 6px;
	background: var(--gws-surface-card);
	color: inherit;
	text-decoration: none;
}

.gws-board__card:hover,
.gws-board__card:focus-visible {
	border-color: currentColor;
}

@media (max-width: 720px) {
	.gws-board { grid-auto-flow: row; grid-auto-columns: auto; overflow-x: visible; }
}

/* --- Marketing calendar (Phase 3) --------------------------------------- */

.gws-calendar {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
	margin-bottom: var(--gws-space-4, 16px);
}

.gws-calendar__dow {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.7;
	padding: 4px 6px;
}

.gws-calendar__day {
	min-height: 96px;
	padding: 6px;
	border: 1px solid var(--gws-border-default);
	border-radius: 6px;
	background: var(--gws-surface-card);
	display: flex;
	flex-direction: column;
	gap: 4px;
	overflow: hidden;
}

.gws-calendar__day--blank { background: transparent; border-style: dashed; opacity: 0.4; }
.gws-calendar__num { font-size: 0.75rem; opacity: 0.7; }

.gws-calendar__item {
	display: block;
	font-size: 0.75rem;
	line-height: 1.3;
	padding: 3px 6px;
	border-radius: 4px;
	border-left: 3px solid currentColor;
	background: var(--gws-surface-subtle);
	color: inherit;
	text-decoration: none;
}

.gws-calendar__item--success { color: var(--gws-status-success); }
.gws-calendar__item--warning { color: var(--gws-status-warning); }
.gws-calendar__item--danger  { color: var(--gws-status-danger); }
.gws-calendar__item--info    { color: var(--gws-status-info); }
.gws-calendar__meta { display: block; opacity: 0.75; }

@media (max-width: 720px) {
	.gws-calendar { grid-template-columns: 1fr; }
	.gws-calendar__dow, .gws-calendar__day--blank { display: none; }
	.gws-calendar__day { min-height: 0; }
}

/* Filter selects should never collapse to the width of "All" (visual pass, 0.7.2). */
.gws-toolbar .gws-field select { min-width: 160px; }
