/*
 * Water Safety - app styles. Mobile first: base rules are the phone layout,
 * min-width queries add the wide layout. GS_ = global style class,
 * JS_ = behaviour hook (never styled).
 */

:root {
	--ws-bg: #f3f6f9;
	--ws-surface: #ffffff;
	--ws-surface-alt: #eef3f7;
	--ws-text: #1b2733;
	--ws-text-muted: #5b6b78;
	--ws-border: #d6dee5;
	--ws-primary: #0b5c8a;
	--ws-primary-text: #ffffff;
	--ws-primary-soft: #e1eef6;
	--ws-danger: #b42318;
	--ws-danger-soft: #fdecea;
	--ws-success: #18794e;
	--ws-success-soft: #e3f4ea;
	--ws-warning: #9a6700;
	--ws-warning-soft: #fff4d6;
	--ws-radius: 10px;
	--ws-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
	--ws-tap: 48px;
	--ws-topbar: 56px;
	--ws-nav-width: 248px;
	--ws-z-nav: 100;
	--ws-z-topbar: 200;
	--ws-z-toast: 300;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--ws-bg: #0f1720;
		--ws-surface: #17212b;
		--ws-surface-alt: #1e2a36;
		--ws-text: #e6edf3;
		--ws-text-muted: #9aabb8;
		--ws-border: #2c3a47;
		--ws-primary: #4aa3d8;
		--ws-primary-text: #06121b;
		--ws-primary-soft: #16354a;
		--ws-danger: #f97066;
		--ws-danger-soft: #3b1714;
		--ws-success: #47cd89;
		--ws-success-soft: #123224;
		--ws-warning: #f5b83d;
		--ws-warning-soft: #3a2d0c;
		color-scheme: dark;
	}
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--ws-bg);
	color: var(--ws-text);
	font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--ws-primary); }

.GS_icon { flex: none; width: 1.25em; font-size: 17px; line-height: 1; text-align: center; }

/* ---------- top bar ---------- */

.GS_topbar {
	position: sticky;
	top: 0;
	z-index: var(--ws-z-topbar);
	display: flex;
	align-items: center;
	gap: 8px;
	height: var(--ws-topbar);
	padding: 0 8px;
	padding-top: env(safe-area-inset-top);
	background: var(--ws-primary);
	color: var(--ws-primary-text);
}

.GS_brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1;
	color: inherit;
	font-weight: 600;
	text-decoration: none;
}

.GS_brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.GS_logo { height: 36px; width: auto; border-radius: 6px; background: #fff; }

.GS_iconButton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--ws-tap);
	height: var(--ws-tap);
	border: 0;
	border-radius: var(--ws-radius);
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.GS_iconButton:focus-visible { outline: 2px solid currentColor; }

.GS_topLink { width: 44px; }

.GS_topLink .GS_icon { font-size: 20px; }

.GS_topLinkCurrent { background: rgba(255, 255, 255, 0.2); }

.GS_avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	color: inherit;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.GS_avatar:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.GS_avatarImage { display: block; width: 100%; height: 100%; object-fit: cover; }

.GS_userMenu { position: relative; margin: 0 4px 0 2px; }

.GS_userMenuPanel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: var(--ws-z-topbar);
	min-width: 230px;
	padding: 6px;
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius);
	background: var(--ws-surface);
	box-shadow: var(--ws-shadow);
}

.GS_userMenuPanel[hidden] { display: none; }

.GS_userMenuWho {
	display: flex;
	flex-direction: column;
	padding: 8px 12px 10px;
	margin-bottom: 4px;
	border-bottom: 1px solid var(--ws-border);
	color: var(--ws-text);
}

.GS_userMenuWho span { overflow: hidden; color: var(--ws-text-muted); font-size: 13px; text-overflow: ellipsis; }

/* dashboard: panels in columns on wide screens, stacked on phones */
.GS_dashboard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.GS_dashColumn { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.GS_rowMenu { margin-left: auto; }
.GS_menuPanel {
	position: fixed;
	z-index: var(--ws-z-nav);
	min-width: 220px;
	padding: 6px;
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius);
	background: var(--ws-surface);
	box-shadow: 0 6px 20px rgba(16, 24, 40, 0.18);
}
.GS_menuPanel[hidden] { display: none; }
.GS_menuPanel form { margin: 0; }
.GS_menuItem {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: var(--ws-tap);
	padding: 0 12px;
	border: 0;
	border-radius: var(--ws-radius);
	background: transparent;
	color: var(--ws-text);
	font: inherit;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.GS_menuItem:hover { background: var(--ws-surface-alt); }
.GS_menuItemDanger { color: var(--ws-danger); }
/* date / time helpers (assets/js/datetime.js) */
.GS_dtTools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.GS_chip {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--ws-border);
	border-radius: 999px;
	background: var(--ws-surface-alt);
	color: var(--ws-primary);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}
.GS_chip:hover { background: var(--ws-primary-soft); }
.GS_dtHint { color: var(--ws-text-muted); font-size: 14px; }
input[type="date"].GS_input, input[type="time"].GS_input { min-height: var(--ws-tap); }

/* class page: next session card, panel anchors */
.GS_anchor { scroll-margin-top: calc(var(--ws-topbar) + 12px); }
.GS_nextSession { border-left: 4px solid var(--ws-primary); }
.GS_nextLabel { color: var(--ws-text-muted); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.GS_nextTitle { font-size: 19px; font-weight: 700; }
.GS_nextActions { margin-top: 12px; }
.GS_nextActions .GS_button { width: 100%; min-height: 52px; font-size: 17px; }
.GS_jumps { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ws-border); }
.GS_more { margin-top: 10px; }
.GS_more summary { padding: 10px 4px; color: var(--ws-primary); cursor: pointer; }
.GS_more .GS_list { margin-top: 6px; }
@media (min-width: 720px) { .GS_nextActions .GS_button { width: auto; min-width: 220px; } }

/* panel header (title + action button): one line everywhere, title truncates, button never shrinks */
.GS_toolbar:has(> .GS_panelTitle.GS_grow), .GS_toolbar.GS_toolbarOneLine { flex-wrap: nowrap; }
.GS_toolbar.GS_toolbarOneLine > :not(.GS_grow) { flex: none; }
.GS_toolbar.GS_toolbarOneLine > .GS_grow { flex-basis: 0; }
.GS_toolbar > .GS_panelTitle.GS_grow { margin: 0; overflow-wrap: anywhere; }
.GS_toolbar:has(> .GS_panelTitle.GS_grow) > :not(.GS_grow) { flex: none; }
.GS_grow { min-width: 0; }
.GS_main, .GS_panel { min-width: 0; max-width: 100%; }
.GS_dashboard .GS_panel { margin: 0; }
.GS_dashWide:empty { display: none; }

@media (min-width: 1100px) {
	.GS_dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
	.GS_dashWide { grid-column: 1 / -1; }
}

.GS_avatarPreview { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 1px solid var(--ws-border); }

/* ---------- navigation ---------- */

.GS_nav {
	display: none;
	position: fixed;
	top: var(--ws-topbar);
	left: 0;
	right: 0;
	bottom: 0;
	z-index: var(--ws-z-nav);
	overflow-y: auto;
	padding: 8px 8px 24px;
	background: var(--ws-surface);
	border-right: 1px solid var(--ws-border);
}

.GS_nav.GS_navOpen { display: block; }

.GS_navGroup { margin-top: 12px; }

.GS_navGroupTitle {
	padding: 4px 12px;
	color: var(--ws-text-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.GS_navLink {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: var(--ws-tap);
	padding: 0 12px;
	border-radius: var(--ws-radius);
	color: var(--ws-text);
	text-decoration: none;
}

.GS_navLink:hover { background: var(--ws-surface-alt); }

.GS_navCurrent { background: var(--ws-primary-soft); color: var(--ws-primary); font-weight: 600; }

@media (min-width: 960px) {
	.GS_topbar .JS_navToggle { display: none; }
	.GS_nav { display: block; width: var(--ws-nav-width); right: auto; }
	.GS_hasNav .GS_main { margin-left: var(--ws-nav-width); }
}

/* ---------- main ---------- */

.GS_main {
	max-width: 1600px;
	padding: 16px;
	padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

@media (min-width: 960px) {
	.GS_main { padding: 24px 32px; }
}

.GS_noNav .GS_main { margin: 0 auto; max-width: 440px; }
.GS_noNav .GS_main:has(.GS_wideForm) { max-width: 960px; }
.GS_formSection, .GS_panelTitle.GS_formSection { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--ws-border); }
.GS_formSection:first-child, .GS_panelTitle.GS_formSection:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.GS_pageHead { margin-bottom: 16px; }

.GS_pageTitle { margin: 0; font-size: 22px; line-height: 1.25; }

.GS_back { display: inline-block; margin-bottom: 6px; font-size: 14px; text-decoration: none; }

/* ---------- panels and layout ---------- */

.GS_panel {
	margin-bottom: 16px;
	padding: 16px;
	background: var(--ws-surface);
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius);
	box-shadow: var(--ws-shadow);
}

.GS_panelTitle { margin: 0 0 12px; font-size: 17px; }

.GS_errorPanel { border-left: 4px solid var(--ws-danger); }

.GS_errorDetail { overflow-x: auto; max-height: 50vh; padding: 10px; background: var(--ws-danger-soft); border-radius: var(--ws-radius); font-size: 12px; white-space: pre; }

.GS_panelHint { margin: -6px 0 12px; color: var(--ws-text-muted); font-size: 14px; }

.GS_checkList { list-style: none; margin: 0 0 12px; padding: 0; }
ul.GS_checkList > .GS_check { padding: 8px 0; border-bottom: 1px solid var(--ws-border, #d5dde3); }
.GS_checkStatus { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; }
.GS_check_ok .GS_checkStatus { color: var(--ws-success); }
.GS_check_warn .GS_checkStatus { color: var(--ws-warning); }
.GS_check_fail .GS_checkStatus { color: var(--ws-danger); }
.GS_checkDetail { display: block; color: var(--ws-text-muted); font-size: 14px; margin-top: 2px; }

.GS_grid { display: grid; gap: 12px; grid-template-columns: 1fr; }

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

.GS_spanAll { grid-column: 1 / -1; }

.GS_toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.GS_grow { flex: 1 1 auto; min-width: 0; }

.GS_toolbar .GS_grow { flex: 1 1 200px; }

.GS_tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.GS_tile {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	background: var(--ws-surface);
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius);
	color: var(--ws-text);
	text-decoration: none;
	box-shadow: var(--ws-shadow);
}

.GS_tile .GS_icon { font-size: 26px; color: var(--ws-primary); text-align: left; }

.GS_tile:hover { border-color: var(--ws-primary); }

/* ---------- forms ---------- */

.GS_field { display: flex; flex-direction: column; gap: 4px; }

.GS_label { font-size: 14px; font-weight: 600; }

.GS_required::after { content: " *"; color: var(--ws-danger); }

.GS_help { color: var(--ws-text-muted); font-size: 13px; }

.GS_input, .GS_select, .GS_textarea {
	width: 100%;
	min-height: var(--ws-tap);
	padding: 10px 12px;
	border: 1px solid var(--ws-border);
	border-radius: 8px;
	background: var(--ws-surface);
	color: var(--ws-text);
	font: inherit;
}

.GS_textarea { min-height: 96px; resize: vertical; }

.GS_input:focus, .GS_select:focus, .GS_textarea:focus {
	outline: 2px solid var(--ws-primary);
	outline-offset: 1px;
	border-color: var(--ws-primary);
}

.GS_fieldError .GS_input, .GS_fieldError .GS_select, .GS_fieldError .GS_textarea { border-color: var(--ws-danger); }

.GS_errorText { color: var(--ws-danger); font-size: 13px; }

.GS_check {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: var(--ws-tap);
	cursor: pointer;
}

.GS_check input { width: 22px; height: 22px; accent-color: var(--ws-primary); }

.GS_formActions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0 24px;
}

.GS_panel .GS_formActions { margin-bottom: 0; }

/* ---------- buttons ---------- */

.GS_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: var(--ws-tap);
	padding: 0 18px;
	border: 1px solid var(--ws-primary);
	border-radius: 8px;
	background: var(--ws-primary);
	color: var(--ws-primary-text);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.GS_button:disabled { opacity: 0.6; cursor: progress; }

.GS_buttonQuiet { background: transparent; color: var(--ws-primary); }

.GS_buttonQuiet:hover { background: var(--ws-primary-soft); }

.GS_row .GS_button { min-height: 40px; padding: 0 14px; }

.GS_buttonDanger { border-color: var(--ws-danger); background: var(--ws-danger); color: #fff; }

.GS_buttonBlock { width: 100%; }

.GS_linkButton {
	padding: 8px 0;
	border: 0;
	background: none;
	color: var(--ws-primary);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- lists (rows, flexdev zones: status / identity / context / actions) ---------- */

.GS_list {
	margin: 0;
	padding: 0;
	list-style: none;
	background: var(--ws-surface);
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius);
	box-shadow: var(--ws-shadow);
	overflow: hidden;
}

.GS_row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 60px;
	padding: 10px 14px 10px 0;
	border-top: 1px solid var(--ws-border);
	color: var(--ws-text);
	text-decoration: none;
}

.GS_row:first-child { border-top: 0; }

a.GS_row:hover { background: var(--ws-surface-alt); }

.GS_rowStatus { align-self: stretch; width: 4px; flex: none; border-radius: 0 3px 3px 0; background: var(--ws-border); }

.GS_rowStatus.GS_statusActive { background: var(--ws-success); }
.GS_rowStatus.GS_statusWarning { background: var(--ws-warning); }
.GS_rowStatus.GS_statusOff { background: var(--ws-text-muted); }
.GS_rowStatus.GS_statusInfo { background: var(--ws-primary); }

.GS_rowMain { flex: 1; min-width: 0; }

.GS_rowTitle, .GS_rowMeta { display: block; }

.GS_rowTitle { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.GS_rowMeta { color: var(--ws-text-muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.GS_rowAside { flex: none; color: var(--ws-text-muted); font-size: 14px; text-align: right; }

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

.GS_empty { padding: 24px 16px; color: var(--ws-text-muted); text-align: center; }

/* ---------- badges ---------- */

.GS_pill {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--ws-surface-alt);
	color: var(--ws-text-muted);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.GS_pillSuccess { background: var(--ws-success-soft); color: var(--ws-success); }
.GS_pillWarning { background: var(--ws-warning-soft); color: var(--ws-warning); }
.GS_pillDanger { background: var(--ws-danger-soft); color: var(--ws-danger); }
.GS_pillInfo { background: var(--ws-primary-soft); color: var(--ws-primary); }

/* ---------- permission matrix ---------- */

.GS_tableWrap { overflow-x: auto; }

.GS_table { width: 100%; border-collapse: collapse; font-size: 14px; }

.GS_table th, .GS_table td { padding: 8px; border-bottom: 1px solid var(--ws-border); text-align: left; vertical-align: middle; }

.GS_table th { color: var(--ws-text-muted); font-weight: 600; }

.GS_table .GS_select { min-width: 110px; min-height: 40px; padding: 6px 8px; }

/* ---------- alerts ---------- */

.GS_alert { margin-bottom: 16px; padding: 12px 14px; border-radius: var(--ws-radius); }
.GS_alertDanger { background: var(--ws-danger-soft); color: var(--ws-danger); }
.GS_alertSuccess { background: var(--ws-success-soft); color: var(--ws-success); }
.GS_alertInfo { background: var(--ws-primary-soft); color: var(--ws-primary); }

/* ---------- toasts and dialog ---------- */

.GS_toasts {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: calc(16px + env(safe-area-inset-bottom));
	z-index: var(--ws-z-toast);
	display: flex;
	flex-direction: column;
	gap: 8px;
	pointer-events: none;
}

@media (min-width: 720px) {
	.GS_toasts { left: auto; width: 360px; }
}

.GS_toast {
	padding: 12px 14px;
	border-radius: var(--ws-radius);
	background: var(--ws-text);
	color: var(--ws-bg);
	box-shadow: var(--ws-shadow);
	pointer-events: auto;
}

.GS_toastDanger { background: var(--ws-danger); color: #fff; }
.GS_toastSuccess { background: var(--ws-success); color: #fff; }

.GS_dialog {
	width: min(420px, calc(100% - 32px));
	padding: 20px;
	border: 0;
	border-radius: var(--ws-radius);
	background: var(--ws-surface);
	color: var(--ws-text);
}

.GS_dialog::backdrop { background: rgba(0, 0, 0, 0.45); }

.GS_dialogMessage { margin-top: 0; }

.GS_dialogActions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- sign-in ---------- */

.GS_signIn { margin-top: 24px; }

.GS_codeInput { font-size: 24px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }

.GS_divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 20px 0;
	color: var(--ws-text-muted);
	font-size: 13px;
}

.GS_divider::before, .GS_divider::after { content: ""; flex: 1; border-top: 1px solid var(--ws-border); }

.GS_logoPreview { max-height: 80px; max-width: 200px; border: 1px solid var(--ws-border); border-radius: 8px; background: #fff; }

.GS_hidden { display: none !important; }

.GS_rowStatus.GS_statusDanger { background: var(--ws-danger); }

.GS_listSpaced { margin-bottom: 20px; }

.GS_sectionTitle { margin: 20px 0 8px; font-size: 17px; }

.GS_definition { display: flex; flex-direction: column; gap: 2px; }

.GS_definition dt { color: var(--ws-text-muted); font-size: 13px; font-weight: 600; }

.GS_definition dd { margin: 0; }

.GS_inlineIcon { font-size: 14px; color: var(--ws-danger); }

/* ---------- tabs ---------- */

.GS_tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; border-bottom: 1px solid var(--ws-border); }

.GS_tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 12px;
	border-bottom: 3px solid transparent;
	color: var(--ws-text-muted);
	text-decoration: none;
	white-space: nowrap;
}

.GS_tabCurrent { border-bottom-color: var(--ws-primary); color: var(--ws-primary); font-weight: 600; }

.GS_tabCount { padding: 0 6px; border-radius: 999px; background: var(--ws-surface-alt); font-size: 12px; }

@media (max-width: 480px) {
	.GS_hideNarrow { display: none; }
}

.GS_row form { margin: 0; }

/* ---------- register (poolside, wet hands: big targets) ---------- */

.GS_registerBar {
	position: sticky;
	top: var(--ws-topbar);
	z-index: 10;
	padding: 8px 0;
	background: var(--ws-bg);
}

.GS_syncState { color: var(--ws-success); font-size: 14px; font-weight: 600; }

.GS_syncState.GS_syncWaiting { color: var(--ws-warning); }

.GS_registerRow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	padding: 10px 12px;
	border-top: 1px solid var(--ws-border);
}

.GS_registerRow:first-child { border-top: 0; }

.GS_registerRow[data-status="1"], .GS_registerRow[data-status="4"] { background: var(--ws-success-soft); }
.GS_registerRow[data-status="2"] { background: var(--ws-danger-soft); }
.GS_registerRow[data-status="3"] { background: var(--ws-surface-alt); }

.GS_registerWho { flex: 1 1 160px; min-width: 0; }

.GS_registerWho .GS_rowTitle, .GS_registerWho .GS_rowMeta { display: block; }

.GS_segmented { display: flex; gap: 6px; }

.GS_segment {
	width: 52px;
	height: 52px;
	border: 2px solid var(--ws-border);
	border-radius: 10px;
	background: var(--ws-surface);
	color: var(--ws-text);
	font: inherit;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	touch-action: manipulation;
}

.GS_segmentWide { width: 72px; font-size: 15px; }

.GS_segment:disabled { cursor: default; opacity: 0.55; }

.GS_segment1[aria-pressed="true"] { border-color: var(--ws-success); background: var(--ws-success); color: #fff; }
.GS_segment4[aria-pressed="true"] { border-color: var(--ws-warning); background: var(--ws-warning); color: #fff; }
.GS_segment2[aria-pressed="true"] { border-color: var(--ws-danger); background: var(--ws-danger); color: #fff; }
.GS_segment3[aria-pressed="true"] { border-color: var(--ws-text-muted); background: var(--ws-text-muted); color: #fff; }

.GS_medical summary { color: var(--ws-danger); font-size: 14px; font-weight: 600; cursor: pointer; }

.GS_medical p { margin: 4px 0 0; font-size: 14px; }

.GS_card { display: block; color: var(--ws-text); text-decoration: none; }

.GS_card:hover { border-color: var(--ws-primary); }

.GS_subTitle { margin: 12px 0 2px; font-size: 16px; }

.GS_stat { font-size: 28px; line-height: 1; color: var(--ws-primary); }

.GS_statDanger { color: var(--ws-danger); }

.GS_rowMeta.GS_wrap { white-space: normal; }

code { padding: 1px 4px; border-radius: 4px; background: var(--ws-surface-alt); font-size: 13px; }

/* ---------- reports ---------- */

.GS_reportTable th[scope="row"] { position: sticky; left: 0; background: var(--ws-surface); white-space: nowrap; }

.GS_reportTable td { text-align: center; white-space: nowrap; }

.GS_cellP, .GS_cellL { color: var(--ws-success); font-weight: 700; }
.GS_cellA { color: var(--ws-danger); font-weight: 700; }
.GS_cellE { color: var(--ws-text-muted); }

@media print {
	.GS_topbar, .GS_nav, .GS_noPrint, .GS_back, .GS_toasts { display: none !important; }
	.GS_hasNav .GS_main { margin-left: 0; }
	.GS_main { max-width: none; padding: 0; }
	.GS_panel { border: 0; box-shadow: none; padding: 0; }
	body { background: #fff; color: #000; }
}

/* ---------- uploader (port of flexUploader) ---------- */

.GS_uploadDrop {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 20px 16px;
	border: 2px dashed var(--ws-border);
	border-radius: var(--ws-radius);
	background: var(--ws-surface-alt);
	text-align: center;
	cursor: pointer;
	user-select: none;
}

.GS_uploadDrop:hover, .GS_uploadDrop:focus-visible, .GS_uploadOver { border-color: var(--ws-primary); background: var(--ws-primary-soft); outline: none; }

.GS_uploadIcon { font-size: 28px; width: auto; color: var(--ws-primary); }

.GS_uploadText { font-weight: 600; }

.GS_uploadProgress { height: 6px; margin-top: 8px; border-radius: 3px; background: var(--ws-surface-alt); overflow: hidden; }

.GS_uploadBar { width: 0; height: 100%; background: var(--ws-primary); transition: width 0.2s; }

.GS_uploadList { margin-top: 8px; }

/* ---------- home ---------- */

.GS_nextCard { border-left: 6px solid var(--ws-primary); }

.GS_nextCancelled { border-left-color: var(--ws-text-muted); opacity: 0.85; }

.GS_nextWhen { color: var(--ws-primary); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }

.GS_nextTitle { margin: 4px 0 2px; font-size: 24px; line-height: 1.2; }

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

.GS_nextStats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; font-size: 15px; }

.GS_nextMedical { color: var(--ws-danger); font-weight: 600; }

.GS_nextActions { display: grid; grid-template-columns: 1fr; gap: 8px; }

@media (min-width: 560px) {
	.GS_nextActions { grid-template-columns: 1fr 1fr; }
}

.GS_buttonLarge { min-height: 56px; font-size: 17px; }

.GS_alertCount {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border-radius: 999px;
	font-weight: 700;
	flex: none;
}

.GS_alertCountDanger { background: var(--ws-danger-soft); color: var(--ws-danger); }
.GS_alertCountWarning { background: var(--ws-warning-soft); color: var(--ws-warning); }

.GS_rowTitle.GS_wrap { white-space: normal; }

.GS_shortcuts { display: flex; flex-wrap: wrap; gap: 8px; }

.GS_shortcut {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--ws-border);
	border-radius: 999px;
	background: var(--ws-surface);
	color: var(--ws-text);
	font-size: 14px;
	text-decoration: none;
}

.GS_shortcut:hover { border-color: var(--ws-primary); color: var(--ws-primary); }

.GS_shortcut .GS_icon { color: var(--ws-primary); font-size: 15px; }

/* ---------- exams ---------- */

.GS_examParts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

.GS_examPart { display: flex; align-items: center; gap: 6px; }

.GS_examPartLabel { min-width: 64px; font-size: 13px; font-weight: 700; color: var(--ws-text-muted); }

.GS_markRow { align-items: center; }

.GS_markInput { width: 76px; flex: none; font-size: 20px; text-align: center; }

.GS_selectSmall { width: auto; min-height: 34px; padding: 4px 8px; font-size: 13px; }

.GS_warnText { color: var(--ws-warning); }

/* ---------- user groups ---------- */

.GS_roleGrid { display: grid; grid-template-columns: 1fr; gap: 12px; }

@media (min-width: 900px) {
	.GS_roleGrid { grid-template-columns: 1fr 1fr; }
}

.GS_roleArea { margin: 0; }

.GS_roleArea legend { padding: 0 6px; font-weight: 700; color: var(--ws-primary); }

.GS_roleOption { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px; border-top: 1px solid var(--ws-border); cursor: pointer; }

.GS_roleOption:first-of-type { border-top: 0; }

.GS_roleOption input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ws-primary); flex: none; }

.GS_chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.GS_chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--ws-primary-soft); color: var(--ws-primary); font-size: 13px; font-weight: 600; }

.GS_chip .GS_icon { font-size: 12px; width: auto; }

/* ---------- syllabus and lesson plans ---------- */

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

.GS_outcome { padding: 10px 0; border-top: 1px solid var(--ws-border); }

.GS_outcome:first-child { border-top: 0; }

.GS_outcomeOff { opacity: 0.55; }

.GS_outcomeHead { display: flex; align-items: center; gap: 10px; }

.GS_outcomeNo {
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	width: 30px; height: 30px; border-radius: 50%; background: var(--ws-primary); color: var(--ws-primary-text); font-weight: 700;
}

.GS_outcomeDetail { margin: 4px 0 0 40px; color: var(--ws-text-muted); font-size: 14px; }

.GS_outcomeGuidance { margin: 4px 0 0 40px; font-size: 14px; }

.GS_planHead .GS_pill { vertical-align: middle; }

.GS_planAims { font-size: 16px; }

.GS_planNotes p { margin: 0; white-space: pre-line; }

.GS_safety { padding: 8px 12px; border-radius: var(--ws-radius); background: var(--ws-warning-soft); }

.GS_timeline { margin: 0 0 24px; padding: 0; list-style: none; }

.GS_timelineItem {
	display: flex; gap: 12px; margin-bottom: 10px; padding: 12px;
	background: var(--ws-surface); border: 1px solid var(--ws-border); border-left: 6px solid var(--ws-primary);
	border-radius: var(--ws-radius); box-shadow: var(--ws-shadow);
}

.GS_phase_warmup { border-left-color: #2e9e6b; }
.GS_phase_land { border-left-color: #8a6d0b; }
.GS_phase_skill { border-left-color: var(--ws-primary); }
.GS_phase_practice { border-left-color: #7a3fb0; }
.GS_phase_game { border-left-color: #d0662a; }
.GS_phase_cooldown { border-left-color: var(--ws-text-muted); }

.GS_timelineTime { flex: none; width: 54px; font-weight: 700; color: var(--ws-primary); text-align: center; line-height: 1.1; }

.GS_timelineTime small { display: block; font-weight: normal; color: var(--ws-text-muted); }

.GS_timelineBody { flex: 1; min-width: 0; }

.GS_timelineBody p { margin: 6px 0; white-space: pre-line; }

.GS_exerciseTitle { margin: 4px 0 0; font-size: 17px; }

.GS_exerciseTools { display: flex; }

.GS_coaching { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--ws-surface-alt); font-size: 14px; }

.GS_coaching p { margin: 2px 0 0; }

.GS_exerciseMeta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; color: var(--ws-text-muted); font-size: 13px; }

.GS_deliveryPanel.GS_isDelivered { border-color: var(--ws-success); background: var(--ws-success-soft); }

.GS_progress { height: 10px; margin: 4px 0 12px; border-radius: 5px; background: var(--ws-surface-alt); overflow: hidden; }

.GS_progressBar { display: block; height: 100%; background: var(--ws-success); }
.GS_w0 { width: 0; } .GS_w10 { width: 10%; } .GS_w20 { width: 20%; } .GS_w30 { width: 30%; } .GS_w40 { width: 40%; }
.GS_w50 { width: 50%; } .GS_w60 { width: 60%; } .GS_w70 { width: 70%; } .GS_w80 { width: 80%; } .GS_w90 { width: 90%; } .GS_w100 { width: 100%; }

.GS_coverage { margin: 0; padding: 0; list-style: none; columns: 1; }

@media (min-width: 720px) {
	.GS_coverage { columns: 2; }
}

.GS_coverage li { padding: 3px 0; color: var(--ws-text-muted); break-inside: avoid; }

.GS_coverage li.GS_covered { color: var(--ws-text); }

.GS_coverage li.GS_covered .GS_icon { color: var(--ws-success); }

@media print {
	.GS_timelineItem { box-shadow: none; break-inside: avoid; }
}

/* title takes the room and wraps itself; number, pills and Edit never wrap away */
.GS_outcomeHead > * { flex: none; }
.GS_outcomeHead > .GS_grow { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }

.GS_exerciseTools { align-items: center; gap: 2px; }

/* row with several actions (lesson plan chooser) */
.GS_planChoice { flex-wrap: wrap; }
.GS_rowActions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
.GS_rowActions form { display: flex; }
.GS_planChoice .GS_rowTitle, .GS_planChoice .GS_rowMeta { white-space: normal; }

/* messaging: audience rules and message text */
.GS_rules { display: grid; gap: 12px; margin-bottom: 12px; }
.GS_rule { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--ws-border); border-radius: var(--ws-radius, 8px); background: var(--ws-surface-alt, transparent); }
.GS_checkList { max-height: 260px; overflow-y: auto; padding: 8px 12px; border: 1px solid var(--ws-border); border-radius: var(--ws-radius, 8px); }
.GS_checkGroupTitle { margin: 8px 0 2px; font-size: 13px; font-weight: 600; color: var(--ws-text-muted); }
.GS_audienceCount { margin: 8px 0 0; font-weight: 600; color: var(--ws-primary); }
.GS_messageBody { line-height: 1.5; overflow-wrap: anywhere; }
.GS_tableWrap { overflow-x: auto; }

/* drag to reorder (.JS_sortable): the handle is the item number */
.GS_dragHandle { border: 0; padding: 0; font: inherit; font-weight: 700; cursor: grab; touch-action: none; }
.GS_outcomeNo.GS_dragHandle:hover, .GS_outcomeNo.GS_dragHandle:focus-visible { outline: 3px solid var(--ws-primary-soft); outline-offset: 1px; }
.GS_outcomeNo.GS_dragHandle { position: relative; }
.GS_outcomeNo.GS_dragHandle::after { content: ""; position: absolute; inset: -6px; } /* 42px touch target, same look */
.GS_sorting, .GS_sorting * { cursor: grabbing; user-select: none; }
.GS_dragging { position: relative; z-index: 1; background: var(--ws-surface); box-shadow: var(--ws-shadow); border-radius: var(--ws-radius); }
.GS_timelineTime.GS_dragHandle { align-self: stretch; background: none; border-radius: 8px; color: var(--ws-primary); }
.GS_timelineTime.GS_dragHandle:hover, .GS_timelineTime.GS_dragHandle:focus-visible { background: var(--ws-primary-soft); outline: none; }

/* searchable dropdown (assets/js/selectsearch.js) */
.GS_comboNative { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.GS_combo { position: relative; }
.GS_comboButton { display: flex; align-items: center; text-align: left; cursor: pointer; padding-right: 36px; font: inherit; color: var(--ws-text);
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.GS_comboValue { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.GS_comboPanel { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); padding: 8px; border: 1px solid var(--ws-border); border-radius: 8px; background: var(--ws-surface); box-shadow: var(--ws-shadow); }
.GS_comboSearch { min-height: 40px; }
.GS_comboList { max-height: 280px; overflow-y: auto; margin: 6px 0 0; padding: 0; list-style: none; }
.GS_comboOption { padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.GS_comboOption[aria-selected="true"] { font-weight: 600; }
.GS_comboOption:hover, .GS_comboActive { background: var(--ws-primary-soft); color: var(--ws-primary); }
.GS_comboGroup { padding: 8px 12px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ws-text-muted); }
.GS_comboEmpty { padding: 10px 12px; color: var(--ws-text-muted); }
