/* SAM app layout – the sidebar design. */
html, body.sam-app-body { margin: 0; padding: 0; background: var(--sam-page, #F5F6F8); }
body.sam-app-body {
	font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--sam-ink, #0F1B2D);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
body.sam-app-body *, body.sam-app-body *::before, body.sam-app-body *::after { box-sizing: border-box; }
body.sam-app-body h1, body.sam-app-body h2, body.sam-app-body h3 { font-family: inherit; color: var(--sam-ink, #0F1B2D); letter-spacing: -0.3px; }

.sam-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 10px 14px; background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D); border-radius: 8px; }
.sam-skip:focus { left: 8px; }

.sam-app { display: flex; flex-wrap: wrap; min-height: 100vh; }
body.admin-bar .sam-app { min-height: calc(100vh - 32px); }

/* Sidebar */
.sam-side {
	flex: 1 1 240px;
	max-width: 100%;
	background: var(--sam-side, #0F1B2D);
	color: var(--sam-side-text, #FFFFFF);
	padding: 20px 16px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}
@media (min-width: 900px) { .sam-side { flex: 0 0 240px; } }
.sam-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: var(--sam-side-text, #FFFFFF); text-decoration: none; }
.sam-brand-mark {
	width: 36px; height: 36px; border-radius: 9px; background: var(--sam-accent, #0B6E6E);
	display: inline-flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 14px; letter-spacing: 0.5px; color: #FFFFFF;
}
.sam-brand-name { font-weight: 600; font-size: 16px; }
.sam-nav { display: flex; flex-direction: column; gap: 2px; }
.sam-nav a {
	display: block; padding: 11px 12px; border-radius: 8px;
	color: var(--sam-side-link, #C6CEDA); text-decoration: none; font-size: 15px; font-weight: 500;
}
.sam-nav a:hover { background: var(--sam-side-hover, #1A2940); color: var(--sam-side-text, #FFFFFF); }
.sam-nav a.is-active { background: var(--sam-side-active, #1F2E44); color: var(--sam-side-text, #FFFFFF); font-weight: 600; }
.sam-nav a:focus-visible { outline: 2px solid var(--sam-side-focus, #5FC4C4); outline-offset: 2px; }
.sam-nav-group { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.sam-nav-group-btn {
	display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px;
	background: transparent; color: var(--sam-side-muted, #8C98AA); font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; text-align: left; cursor: pointer;
}
.sam-nav-group-btn:hover { background: var(--sam-side-hover, #1A2940); color: var(--sam-side-text, #FFFFFF); }
.sam-nav-group-btn:focus-visible { outline: 2px solid var(--sam-side-focus, #5FC4C4); outline-offset: 2px; }
.sam-nav-group-btn svg { flex: 0 0 auto; transition: transform 0.15s; transform: rotate(-90deg); }
.sam-nav-group.is-open .sam-nav-group-btn svg { transform: none; }
.sam-nav-group.has-active:not(.is-open) .sam-nav-group-btn { color: var(--sam-side-text, #FFFFFF); }
.sam-nav-group-items { display: flex; flex-direction: column; gap: 2px; }
.sam-nav-group:not(.is-open) .sam-nav-group-items { display: none; }
.sam-nav-group-items a { padding-left: 20px; }
.sam-nav-label { padding: 16px 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--sam-side-muted, #8C98AA); }
/* An open group stands out (1.71): a tinted panel, its heading in the highlight colour with a bar on the left, and a guide line beside its links. */
@media all {
	.sam-nav-group { border-radius: 10px; transition: background-color 0.15s; }
	.sam-nav-group.is-open { background: var(--sam-side-hover, #1A2940); padding-bottom: 6px; }
	.sam-nav-group.is-open .sam-nav-group-btn { background: var(--sam-side-active, #1F2E44); color: var(--sam-side-focus, #5FC4C4); box-shadow: inset 3px 0 0 var(--sam-side-focus, #5FC4C4); border-radius: 10px 10px 4px 4px; }
	.sam-nav-group.is-open .sam-nav-group-btn:hover { color: var(--sam-side-text, #FFFFFF); }
	.sam-nav-group.is-open .sam-nav-group-items { margin: 4px 6px 0 18px; padding-left: 6px; border-left: 1px solid var(--sam-side-active, #2A3A52); }
	.sam-nav-group.is-open .sam-nav-group-items a { padding-left: 12px; }
	.sam-nav-group.is-open .sam-nav-group-items a.is-active { box-shadow: inset 2px 0 0 var(--sam-side-focus, #5FC4C4); }
}
/* The logo row; on phones it also holds the menu button. */
.sam-side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sam-menu-btn { display: none; }
.sam-menu-backdrop { display: none; }

/*
 * Phones and narrow windows (1.71): a slim bar with the logo and a menu button. The button slides the whole sidebar
 * in from the left – the same groups and links as on a computer – over a dimmed page.
 */
@media (max-width: 899px) {
	.sam-side { position: sticky; top: 0; z-index: 50; padding: 10px 12px 10px 16px; gap: 0; }
	.sam-side > .sam-nav, .sam-side > .sam-side-version { display: none; }
	.sam-menu-btn {
		display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border: 1px solid var(--sam-side-active, #2A3A52); border-radius: 10px;
		background: var(--sam-side-hover, #1A2940); color: var(--sam-side-text, #FFFFFF); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
	}
	.sam-menu-btn:focus-visible { outline: 2px solid var(--sam-side-focus, #5FC4C4); outline-offset: 2px; }
	.sam-menu-btn .sam-menu-x { display: none; }
	/* Open */
	body.sam-menu-open { overflow: hidden; }
	body.sam-menu-open .sam-side {
		position: fixed; top: 0; bottom: 0; left: 0; z-index: 1001; width: min(300px, 86vw); max-width: none;
		overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 20px 16px; gap: 20px;
		box-shadow: 12px 0 40px rgba(8, 15, 28, 0.35); animation: sam-menu-in 0.18s ease-out;
	}
	body.admin-bar.sam-menu-open .sam-side { top: 46px; }
	body.sam-menu-open .sam-side > .sam-nav { display: flex; }
	body.sam-menu-open .sam-side > .sam-side-version { display: block; }
	body.sam-menu-open .sam-menu-btn { border-color: transparent; background: transparent; padding: 0 10px; }
	body.sam-menu-open .sam-menu-btn .sam-menu-bars, body.sam-menu-open .sam-menu-btn .sam-menu-word { display: none; }
	body.sam-menu-open .sam-menu-btn .sam-menu-x { display: block; }
	body.sam-menu-open .sam-menu-backdrop { display: block; position: fixed; inset: 0; z-index: 1000; background: rgba(15, 27, 45, 0.5); }
	/* Keep the page from jumping when the bar leaves the flow. */
	body.sam-menu-open .sam-body { padding-top: var(--sam-bar-h, 64px); }
}
@keyframes sam-menu-in { from { transform: translateX(-24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.sam-menu-open .sam-side { animation: none; } }

/* Main column */
.sam-body { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.sam-top {
	background: var(--sam-surface, #FFFFFF); border-bottom: 1px solid var(--sam-line, #E3E6EB);
	padding: 14px 32px;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.sam-switch { display: flex; align-items: center; gap: 10px; margin: 0; }
.sam-switch label { font-size: 14px; font-weight: 600; color: var(--sam-muted, #5A6474); }
.sam-switch select {
	height: 44px; padding: 0 12px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 8px;
	font: inherit; font-size: 15px; background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D);
}
.sam-switch-one { font-weight: 600; }
.sam-me { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.sam-avatar {
	width: 36px; height: 36px; border-radius: 999px; background: var(--sam-accent-soft, #DDF1EF); color: var(--sam-accent-ink, #0A5C5C);
	display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.sam-me-name { font-weight: 500; }
.sam-me-role { font-weight: 400; opacity: .8; } /* Their user group after the name (1.100.20). */
@media (max-width: 520px) { .sam-me-role { display: none; } } /* No room on small phones. */
.sam-me a { color: var(--sam-accent, #0B6E6E); font-size: 14px; font-weight: 500; }

/* Pages fill the screen, whatever its size (1.100.9 – it was 1080px, which left half a large monitor empty); the grids of
   boxes and cards add columns as there's room. Pages that read better narrow (forms, My Profile) keep their own width. */
.sam-main { padding: 32px; width: 100%; max-width: none; box-sizing: border-box; }
@media (min-width: 1600px) { .sam-main { padding: 36px 44px; } }
.sam-page-title { margin: 0 0 24px; font-size: 30px; font-weight: 700; }
@media (max-width: 600px) {
	.sam-top, .sam-main { padding-left: 16px; padding-right: 16px; }
}

/* Dashboard */
.sam-dashboard { display: flex; flex-direction: column; gap: 32px; }
.sam-dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.sam-dash-title { margin: 0 0 6px; font-size: 30px; font-weight: 700; line-height: 1.2; }
.sam-dash-sub { margin: 0; font-size: 16px; color: var(--sam-muted, #5A6474); }
.sam-dash-section { display: flex; flex-direction: column; gap: 16px; }
.sam-dash-section h2 { margin: 0; font-size: 18px; font-weight: 600; }
.sam-dash-section .sam { margin: 0; }

.sam-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.sam-card {
	background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius, 14px); padding: 20px;
	display: flex; flex-direction: column; gap: 10px;
	color: var(--sam-ink, #0F1B2D); text-decoration: none;
	transition: border-color .15s, box-shadow .15s;
}
.sam a.sam-card, .sam a.sam-card:hover { color: var(--sam-ink, #0F1B2D); }
a.sam-card:hover { border-color: #B9C2CE; box-shadow: 0 2px 8px rgba(15, 27, 45, 0.06); }
a.sam-card:focus-visible { outline: 2px solid var(--sam-accent, #0B6E6E); outline-offset: 2px; }
.sam-card-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.sam-card-title { font-size: 16px; font-weight: 600; }
.sam-card-desc { font-size: 14px; color: var(--sam-muted, #5A6474); line-height: 1.5; }
/* Dashboard quick links: smaller boxes, icon beside the title */
.sam-cards-quick { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.sam-cards-quick .sam-card { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: center; padding: 12px 14px; }
.sam-cards-quick .sam-card-icon { grid-row: span 2; width: 36px; height: 36px; }
.sam-cards-quick .sam-card-title { font-size: 15px; line-height: 1.3; }
.sam-cards-quick .sam-card-desc { font-size: 13px; line-height: 1.35; }
.sam-cards-quick .sam-card:not(:has(.sam-card-desc)) .sam-card-icon { grid-row: auto; }
@media (max-width: 600px) { .sam-cards-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .sam-cards-quick .sam-card { padding: 10px 12px; column-gap: 10px; } .sam-cards-quick .sam-card-desc { display: none; } .sam-cards-quick .sam-card-icon { grid-row: auto; width: 32px; height: 32px; } }
.sam-tone-teal { background: var(--sam-tone-teal-soft, #DDF1EF); color: var(--sam-tone-teal-ink, #0A5C5C); }
.sam-tone-blue { background: var(--sam-tone-blue-soft, #E4ECFB); color: var(--sam-tone-blue-ink, #1D4ED8); }
.sam-tone-amber { background: var(--sam-tone-amber-soft, #FFF1D6); color: var(--sam-tone-amber-ink, #7A4F00); }
.sam-tone-grey { background: var(--sam-tone-grey-soft, #EEF0F3); color: var(--sam-tone-grey-ink, #3E4858); }

/* Sign-in page */
body.sam-login-body { min-height: 100vh; display: flex; flex-direction: column; }
.sam-login-top { background: var(--sam-surface, #FFFFFF); border-bottom: 1px solid var(--sam-line, #E3E6EB); padding: 16px 24px; }
.sam-brand-dark { color: var(--sam-ink, #0F1B2D); }
.sam-brand-dark .sam-brand-mark { color: #FFFFFF; }
.sam-brand-dark:hover { color: var(--sam-ink, #0F1B2D); }
.sam-login-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; }
.sam-login-card {
	width: 100%; max-width: 440px; background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius-lg, 16px);
	padding: 32px; display: flex; flex-direction: column; gap: 20px;
}
.sam-login-card h1 { margin: 0; font-size: 24px; font-weight: 700; }
.sam-login-intro { margin: -14px 0 0; font-size: 15px; color: var(--sam-muted, #5A6474); }
.sam-login-error { margin: 0; padding: 12px 14px; border-radius: 10px; background: #FDECEC; color: #8A1C1C; font-size: 14px; font-weight: 500; }
.sam-login-form { display: flex; flex-direction: column; gap: 20px; margin: 0; }
.sam-field { display: flex; flex-direction: column; gap: 6px; }
.sam-field label { font-size: 14px; font-weight: 600; }
.sam-field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sam-field-row a { font-size: 14px; font-weight: 500; }
.sam-field input {
	height: 48px; padding: 0 14px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 10px;
	font: inherit; font-size: 16px; color: var(--sam-ink, #0F1B2D); background: var(--sam-surface, #FFFFFF); width: 100%;
}
.sam-field input:focus { outline: none; border-color: var(--sam-accent, #0B6E6E); box-shadow: 0 0 0 3px var(--sam-accent-ring, rgba(11, 110, 110, 0.2)); }
.sam-check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--sam-ink-2, #3E4858); }
.sam-check input { width: 18px; height: 18px; margin: 0; }
.sam-btn-block { width: 100%; height: 48px; font-size: 16px; }
.sam-login-foot { margin: 0; font-size: 14px; color: var(--sam-muted, #5A6474); }
.sam-login-note { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--sam-accent-soft, #DDF1EF); color: var(--sam-accent-ink, #0A5C5C); font-size: 14px; font-weight: 500; }

/* Public pages (Open Forms) */
body.sam-public-body { min-height: 100vh; }
.sam-public-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.sam .sam-btn-dark, .sam-btn.sam-btn-dark { background: #0F1B2D; }
.sam-btn.sam-btn-dark:hover { background: #1F2E44; }
.sam-public-main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 48px 24px 64px; }
.sam-public-main > p { margin: -12px 0 24px; font-size: 17px; color: #4A5464; max-width: 640px; }
.sam-open-forms { margin: 0; }
@media (max-width: 600px) { .sam-public-main { padding: 32px 16px 48px; } }

/* Card icons using your own image */
.sam-card-icon-img { background: #F0F2F5; overflow: hidden; }
.sam-card-icon-img img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* "Open form" link at the foot of the sign-in card */
.sam a.sam-login-open, a.sam-login-open {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	margin-top: -4px; padding: 14px 16px; border-radius: 10px;
	background: var(--sam-page, #F5F6F8); border: 1px solid var(--sam-line, #E3E6EB);
	color: var(--sam-ink, #0F1B2D); text-decoration: none; font-size: 15px;
}
.sam a.sam-login-open:hover { border-color: #B9C2CE; color: var(--sam-ink, #0F1B2D); }
.sam a.sam-login-open strong { color: var(--sam-accent, #0B6E6E); }

/* Energy dashboard */
.sam-energy { display: flex; flex-direction: column; gap: 28px; }
.sam-en-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.sam-en-h2 { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.sam-en-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.sam-en-row .sam-en-h2 { margin: 0; }
.sam a.sam-btn-ghost, .sam-btn.sam-btn-ghost { background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D) !important; border: 1px solid var(--sam-line-strong, #D5DAE1); }
.sam a.sam-btn-ghost:hover { background: var(--sam-page, #F5F6F8); }

.sam-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--sam-line, #E3E6EB); }
.sam .sam-tabs a { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--sam-muted, #5A6474); text-decoration: none; font-weight: 500; }
.sam .sam-tabs a:hover { color: var(--sam-ink, #0F1B2D); }
.sam .sam-tabs a.is-active { color: var(--sam-ink, #0F1B2D); border-bottom-color: var(--sam-accent, #0B6E6E); font-weight: 600; }

.sam-seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--sam-fill, #EEF0F3); border-radius: 10px; }
.sam .sam-seg a { padding: 8px 14px; border-radius: 8px; color: var(--sam-muted, #5A6474); text-decoration: none; font-size: 14px; font-weight: 600; }
.sam .sam-seg a.is-active { background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D); box-shadow: 0 1px 2px rgba(15, 27, 45, 0.12); }

.sam-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.sam-tile { background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius, 14px); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.sam-tile-name { font-weight: 600; font-size: 15px; }
.sam-tile-kind { font-size: 12px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--sam-muted, #5A6474); }
.sam-tile-value { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.sam-tile-value small { font-size: 15px; font-weight: 500; color: var(--sam-muted, #5A6474); letter-spacing: 0; }
.sam-tile-use { font-size: 14px; color: var(--sam-ink-2, #3E4858); }
.sam-tile-use strong { color: var(--sam-ink, #0F1B2D); font-variant-numeric: tabular-nums; }
.sam-tile-time { font-size: 13px; color: var(--sam-muted, #5A6474); margin-top: 6px; }

.sam-en-group { font-size: 13px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--sam-muted, #5A6474); margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--sam-line, #E3E6EB); }
.sam-en-h2 + .sam-en-group, .sam-en-row + .sam-en-group, .sam-en-day + .sam-en-group { margin-top: 6px; }
.sam-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.sam-chart { margin: 0; background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius, 14px); padding: 18px 20px; }
.sam-chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.sam-chart-name { font-weight: 600; font-size: 15px; }
.sam-chart-sub { font-size: 13px; color: var(--sam-muted, #5A6474); }
.sam-chart-total { margin-left: auto; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sam-chart-empty { margin: 24px 0; color: var(--sam-muted, #5A6474); font-size: 14px; }
.sam-bars { display: block; width: 100%; height: auto; overflow: visible; }
.sam-bars .sam-grid { stroke: #EEF0F3; stroke-width: 1; }
.sam-bars .sam-base { stroke: #C9CFD8; stroke-width: 1; }
.sam-bars .sam-axis { fill: var(--sam-muted, #5A6474); font-size: 14px; font-family: inherit; }
.sam-bars .sam-bar-fill { fill: var(--sam-accent, #0B6E6E); }
.sam-bars .sam-hit { fill: transparent; }
.sam-bars .sam-line { fill: none; stroke: #D9822B; stroke-width: 2; stroke-linejoin: round; }
.sam-bars .sam-bar:hover .sam-bar-fill { fill: var(--sam-accent-dark, #085454); }
.sam-bars .sam-bar:hover .sam-hit { fill: rgba(15, 27, 45, 0.04); }
.sam-chart-table { margin-top: 10px; font-size: 14px; }
.sam-chart-table summary { cursor: pointer; color: var(--sam-accent, #0B6E6E); font-weight: 500; }
.sam-chart-table .sam-table { margin-top: 8px; min-width: 0; }
.sam-chart-table .sam-table th, .sam-chart-table .sam-table td { padding: 8px 12px; }

/* CHP manual readings panel */
.sam-chp { background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius, 14px); }
.sam-chp > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 16px 20px; font-weight: 600; font-size: 16px; }
.sam-chp > summary::-webkit-details-marker { display: none; }
.sam-chp > summary::before { content: "+"; display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 6px; background: var(--sam-accent-soft, #DDF1EF); color: var(--sam-accent-ink, #0A5C5C); font-weight: 700; }
.sam-chp[open] > summary::before { content: "–"; }
.sam-chp-hint { font-weight: 400; font-size: 14px; color: var(--sam-muted, #5A6474); }
.sam-chp .sam-notice { margin: 0 20px 12px; }
.sam-chp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; padding: 0 20px 20px; margin: 0; }
.sam-chp-form .sam-field input { height: 48px; padding: 0 14px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 10px; font: inherit; font-size: 16px; width: 100%; background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D); }
.sam-chp-form .sam-field input:focus { outline: none; border-color: var(--sam-accent, #0B6E6E); box-shadow: 0 0 0 3px var(--sam-accent-ring, rgba(11, 110, 110, 0.2)); }
.sam-chp-form .sam-field label { font-size: 14px; font-weight: 600; }
/* 2.1.12 (the user's screenshot): a long meter name wraps its label onto two lines – keep every box on one line along the bottom. */
.sam-chp-form > .sam-field { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-width: 0; margin: 0; }
.sam-chp-form > .sam-field label { margin: 0; line-height: 1.3; }
.sam-chp-form > .sam-field label .sam-muted { white-space: nowrap; }
.sam-chp-form .sam-field input { box-sizing: border-box; }
.sam-chp-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; }

/* Appearance: logos */
.sam-brand-logo { display: block; height: var(--sam-logo-h, 36px); width: auto; max-width: 180px; object-fit: contain; }
.sam-brand-mark { background: var(--sam-accent, #0B6E6E); min-width: 36px; width: auto; padding: 0 6px; }
.sam-top-site { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sam-site-logo { display: block; height: 36px; width: auto; max-width: 140px; object-fit: contain; }
.sam-login-logo { display: block; height: calc(var(--sam-logo-h, 36px) * 1.5); width: auto; max-width: 100%; object-fit: contain; align-self: flex-start; }
.sam-en-title { display: flex; align-items: center; gap: 14px; }
.sam-en-logo { display: block; height: 40px; width: auto; max-width: 160px; object-fit: contain; }

/* Appearance: box colours (one set of variables per colour name) */
.sam-card-tone-teal   { --t-soft: var(--sam-tone-teal-soft, #DDF1EF);   --t-ink: var(--sam-tone-teal-ink, #0A5C5C);   --t-solid: var(--sam-tone-teal-solid, #0B6E6E);   --t-on: var(--sam-tone-teal-on, #FFFFFF); }
.sam-card-tone-blue   { --t-soft: var(--sam-tone-blue-soft, #E4ECFB);   --t-ink: var(--sam-tone-blue-ink, #1D4ED8);   --t-solid: var(--sam-tone-blue-solid, #1D4ED8);   --t-on: var(--sam-tone-blue-on, #FFFFFF); }
.sam-card-tone-amber  { --t-soft: var(--sam-tone-amber-soft, #FFF1D6);  --t-ink: var(--sam-tone-amber-ink, #7A4F00);  --t-solid: var(--sam-tone-amber-solid, #B45309);  --t-on: var(--sam-tone-amber-on, #FFFFFF); }
.sam-card-tone-grey   { --t-soft: var(--sam-tone-grey-soft, #EEF0F3);   --t-ink: var(--sam-tone-grey-ink, #3E4858);   --t-solid: var(--sam-tone-grey-solid, #4A5464);   --t-on: var(--sam-tone-grey-on, #FFFFFF); }
.sam-card-tone-green  { --t-soft: var(--sam-tone-green-soft, #DCEFE2);  --t-ink: var(--sam-tone-green-ink, #12652F);  --t-solid: var(--sam-tone-green-solid, #15803D);  --t-on: var(--sam-tone-green-on, #FFFFFF); }
.sam-card-tone-purple { --t-soft: var(--sam-tone-purple-soft, #EAE1F9); --t-ink: var(--sam-tone-purple-ink, #5B21B6); --t-solid: var(--sam-tone-purple-solid, #6D28D9); --t-on: var(--sam-tone-purple-on, #FFFFFF); }
.sam-card-tone-red    { --t-soft: var(--sam-tone-red-soft, #F6DEDE);    --t-ink: var(--sam-tone-red-ink, #991B1B);    --t-solid: var(--sam-tone-red-solid, #B91C1C);    --t-on: var(--sam-tone-red-on, #FFFFFF); }
.sam-tone-green  { background: var(--sam-tone-green-soft, #DCEFE2);  color: var(--sam-tone-green-ink, #12652F); }
.sam-tone-purple { background: var(--sam-tone-purple-soft, #EAE1F9); color: var(--sam-tone-purple-ink, #5B21B6); }
.sam-tone-red    { background: var(--sam-tone-red-soft, #F6DEDE);    color: var(--sam-tone-red-ink, #991B1B); }

/* Tinted boxes: the whole box takes the light shade */
.sam-cards-tinted .sam-card { background: var(--t-soft); border-color: transparent; }
.sam .sam-cards-tinted a.sam-card, .sam .sam-cards-tinted a.sam-card:hover, .sam-cards-tinted .sam-card { color: var(--t-ink); }
.sam-cards-tinted .sam-card-desc { color: var(--t-ink); }
.sam-cards-tinted .sam-card-icon { background: var(--sam-surface, #FFFFFF); color: var(--t-ink); }
.sam-cards-tinted a.sam-card:hover { border-color: var(--t-ink); box-shadow: none; }

/* Solid boxes: the whole box is filled with the colour */
.sam-cards-solid .sam-card { background: var(--t-solid); border-color: transparent; }
.sam .sam-cards-solid a.sam-card, .sam .sam-cards-solid a.sam-card:hover, .sam-cards-solid .sam-card { color: var(--t-on); }
.sam-cards-solid .sam-card-desc { color: var(--t-on); }
.sam-cards-solid .sam-card-icon { background: rgba(255, 255, 255, 0.18); color: var(--t-on); }
.sam-cards-solid .sam-card-icon-img { background: var(--sam-surface, #FFFFFF); }
.sam-cards-solid a.sam-card:hover { box-shadow: 0 4px 14px rgba(15, 27, 45, 0.18); }
.sam-cards-solid a.sam-card:focus-visible { outline-color: var(--t-solid); outline-offset: 3px; }

/* Dashboard: headline numbers, projects and H&S panels */
.sam-dash-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sam-dash-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
a.sam-kpi { text-decoration: none; color: var(--sam-ink, #0F1B2D); transition: border-color .15s, box-shadow .15s; }
.sam a.sam-kpi, .sam a.sam-kpi:hover { color: var(--sam-ink, #0F1B2D); }
a.sam-kpi:hover { border-color: #B9C2CE; box-shadow: 0 2px 8px rgba(15, 27, 45, 0.06); }
a.sam-kpi:focus-visible { outline: 2px solid var(--sam-accent, #0B6E6E); outline-offset: 2px; }
.sam-kpi .sam-hs-chip { margin: -2px 0 2px; }
.sam-kpi.is-warn .sam-tile-use { color: #8A1C1C; font-weight: 600; }

.sam-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; align-items: start; }
.sam-dash-panel { background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius, 14px); padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sam-dash-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sam-dash-panel-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.sam-dash-panel-head a { font-size: 14px; font-weight: 600; }
.sam-dash-h3 { margin: 8px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--sam-muted, #5A6474); }
.sam-dash-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--sam-fill, #EEF0F3); color: var(--sam-ink-2, #3E4858); font-size: 12px; text-align: center; letter-spacing: 0; }
.sam-dash-none { margin: 0; font-size: 14px; color: var(--sam-muted, #5A6474); }

.sam-dash-status { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0 0 4px; list-style: none; font-size: 14px; }
.sam-dash-status a { color: var(--sam-ink, #0F1B2D); text-decoration: none; }
.sam-dash-status a:hover { text-decoration: underline; }
.sam-dash-status strong { font-variant-numeric: tabular-nums; }

.sam-dash-tasks, .sam-dash-hs { margin: 0; padding: 0; list-style: none; }
.sam-dash-tasks li, .sam-dash-hs li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--sam-line-soft, #EEF0F3); }
.sam-dash-tasks li:first-child, .sam-dash-hs li:first-child { border-top: 0; }
.sam a.sam-dash-task { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: var(--sam-ink, #0F1B2D); }
.sam a.sam-dash-task:hover .sam-dash-task-t { text-decoration: underline; }
.sam-dash-task-t { font-weight: 600; font-size: 15px; }
.sam-dash-task-p { display: block; font-size: 13px; color: var(--sam-muted, #5A6474); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sam-dash-due { flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--sam-ink-2, #3E4858); white-space: nowrap; }
.sam-dash-due.is-late { color: #B42318; }

.sam-dash-hs-site { min-width: 0; font-weight: 600; font-size: 15px; }
.sam-dash-hs-score { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
@media (max-width: 600px) {
	.sam-dash-hs li { flex-wrap: wrap; }
}
@media (max-width: 600px) { .sam-dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .sam-dash-kpis .sam-tile { padding: 14px; } .sam-dash-kpis .sam-tile-value { font-size: 24px; } }

/* "Admin" sub-heading in the sidebar: bolder, brighter, with a dividing line above */
.sam-nav-label {
	margin-top: 14px; padding: 16px 12px 8px;
	border-top: 1px solid var(--sam-side-active, #1F2E44);
	font-size: 13px; font-weight: 800; letter-spacing: 1px;
	color: var(--sam-side-text, #FFFFFF);
}

/* Energy contracts & rates */
.sam-rates .sam-tile-name { font-size: 16px; }
.sam-rate-supplier { font-weight: 500; color: var(--sam-muted, #5A6474); }
.sam-rate-list { margin: 6px 0 2px; display: flex; flex-direction: column; gap: 6px; }
.sam-rate-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--sam-line-soft, #EEF0F3); padding-bottom: 6px; }
.sam-rate-list dt { font-size: 14px; color: var(--sam-ink-2, #3E4858); }
.sam-rate-list dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sam-rate-list dd small { font-size: 13px; font-weight: 500; color: var(--sam-muted, #5A6474); }
.sam-rate-chip { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.sam-rate-chip.is-green { background: #DCEFE2; color: #12652F; }
.sam-rate-chip.is-amber { background: #FFF1D6; color: #7A4F00; }
.sam-rate-chip.is-red { background: #FDECEC; color: #8A1C1C; }
.sam-rate-chip.is-blue { background: #E3EDFA; color: #1D4F91; }
.sam-rate-edit { margin-top: 16px; background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius, 14px); padding: 14px 20px; }
.sam-rate-edit > summary { cursor: pointer; font-weight: 600; color: var(--sam-accent, #0B6E6E); }
.sam-rate-edit form { display: flex; flex-direction: column; gap: 18px; margin: 16px 0 4px; }
.sam-rate-edit form > .sam-btn { align-self: flex-start; }
.sam-rate-set { margin: 0; padding: 14px 16px; border: 1px solid var(--sam-line, #E3E6EB); border-radius: 12px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sam-rate-set legend { padding: 0 6px; font-weight: 700; }
.sam-rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px 16px; }
.sam-rate-pair { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.sam-rate-edit .sam-field { font-size: 14px; font-weight: 600; }
.sam-rate-edit .sam-field input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 10px; font: inherit; font-weight: 400; font-size: 16px; width: 100%; background: var(--sam-surface, #FFFFFF); }
.sam-rate-edit .sam-field input:focus { outline: none; border-color: var(--sam-accent, #0B6E6E); box-shadow: 0 0 0 3px var(--sam-accent-ring, rgba(11, 110, 110, 0.2)); }
.sam-en-day { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 14px; }
.sam-en-day input[type=date] { min-height: 40px; padding: 6px 10px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 8px; font: inherit; background: var(--sam-surface, #FFFFFF); }
.sam-en-day .sam-btn { min-width: 44px; justify-content: center; }
.sam-en-dayname { font-weight: 600; color: var(--sam-ink, #0F1B2D); }
.sam-en-range-field { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--sam-ink, #0F1B2D); }
.sam-en-range select { min-height: 40px; padding: 6px 10px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 10px; background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D); font-size: 16px; }
.sam-en-csv { position: relative; }
.sam-en-csv > summary { list-style: none; cursor: pointer; }
.sam-en-csv > summary::-webkit-details-marker { display: none; }
.sam-en-csv-box { position: absolute; right: 0; z-index: 30; width: 300px; max-width: calc(100vw - 32px); margin-top: 8px; padding: 18px; border: 1px solid var(--sam-line, #E3E7ED); border-radius: 14px; background: var(--sam-surface, #FFFFFF); box-shadow: 0 12px 32px rgba(15, 27, 45, 0.18); }
.sam-en-csv-box .sam-field { display: block; margin: 0 0 12px; }
.sam-en-csv-box select { display: block; box-sizing: border-box; width: 100%; height: 48px; margin-top: 4px; padding: 0 12px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 10px; background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D); font-size: 16px; }
.sam-en-csv-box .sam-muted { margin: 0 0 12px; font-size: 13px; }
@media (max-width: 620px) {
	.sam-en-csv[open] { flex-basis: 100%; }
	.sam-en-csv-box { position: static; box-sizing: border-box; width: auto; max-width: none; }
}
.sam-dash-sub-h { margin: 14px 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--sam-muted, #5A6474); }
.sam-rate-chip.is-grey { background: var(--sam-fill, #EEF0F3); color: var(--sam-ink-2, #3E4858); }
.sam-rate-next { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #F1F6FD; border: 1px solid #D3E1F5; display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: #1F2A3A; }
.sam-rate-next strong { color: #1D4F91; }
.sam-rate-history { margin-top: 16px; background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius, 14px); padding: 14px 20px; }
.sam-rate-history > summary { cursor: pointer; font-weight: 600; color: var(--sam-accent, #0B6E6E); }
.sam-rate-history .sam-table td { vertical-align: top; }
.sam-rate-history .sam-rate-chip { margin-top: 0; white-space: nowrap; }
.sam-rate-add > summary, .sam-rate-one > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.sam-rate-add > summary { color: var(--sam-accent, #0B6E6E); }
.sam-rate-one { border-top: 1px solid var(--sam-line-soft, #EEF0F3); padding-top: 4px; }
.sam-rate-edit .sam-rate-form { display: flex; flex-direction: column; gap: 14px; margin: 10px 0 8px; }
.sam-rate-edit .sam-rate-form .sam-pr-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sam-notice.is-warn { background: #FFF1D6; color: #7A4F00; }
.sam-rate-edit .sam-field input { box-sizing: border-box; min-width: 0; }
.sam-choose .sam-cards { margin-top: 8px; }
.sam-card-logo { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; height: 72px; padding: 12px 14px; background: #FFFFFF; border: 1px solid var(--sam-line, #E3E8EF); border-radius: 10px; } /* 2.2.5 (the user's wish): the white tile runs the box's full width, the logo centred. */
.sam-card-logo:empty { background: transparent; border-color: transparent; } /* A site with no logo keeps the space, so the names still line up. */
.sam-card-logo img { display: block; max-width: 100%; max-height: 48px; width: auto; height: auto; object-fit: contain; }
.sam-card-go { margin-top: auto; font-size: 14px; font-weight: 600; color: var(--sam-accent, #0B6E6E); }
.sam-rates-all td, .sam-rates-all th { vertical-align: top; }
.sam-rates-all .sam-rate-chip { margin-top: 6px; }
.sam-rates-next-note { display: inline-block; margin-top: 6px; font-size: 13px; color: #1D4F91; font-weight: 600; }
.sam-rates-all tbody th { font-size: 15px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--sam-line-soft, #EEF0F3); }

/* Version number at the foot of the sidebar */
.sam-side-version { margin-top: auto; padding: 18px 12px 6px; font-size: 11px; letter-spacing: .4px; color: var(--sam-side-muted, #8C98AA); }
.sam-side-version a { color: inherit; text-decoration: none; }
.sam-side-version a:hover { text-decoration: underline; }

/* Capitalisation: field labels, table headings, buttons, tabs, menu items and page headings in Title Case.
   Wrapped in :where() so any heading styled in capitals (e.g. section headers) keeps that style. */
:where(.sam .sam-field > label, .sam .sam-filters > label, .sam .sam-po-ml, .sam th, .sam .sam-tabs a, .sam .sam-btn,
	.sam .sam-dash-title, .sam .sam-stock-h2, .sam .sam-stock-h3, .sam .sam-sf-h2, .sam .sam-card-title, .sam-page-title, .sam-nav a) { text-transform: capitalize; }
/* …but not the small notes inside labels, ticked-box sentences, or anything typed by people. */
.sam .sam-field > label .sam-muted,
.sam .sam-filters > label .sam-muted,
.sam th .sam-muted,
.sam .sam-check { text-transform: none; }
.sam label input, .sam label select, .sam label textarea { text-transform: none; }

/* Install SAM as an app (dashboard hint, assets/pwa.js) */
.sam-install { display: flex; align-items: center; gap: 12px; background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-left: 4px solid var(--sam-accent, #0B6E6E); border-radius: var(--sam-radius, 14px); padding: 12px 12px 12px 16px; }
.sam-install[hidden] { display: none; }
.sam-install-icon { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.sam-install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--sam-muted, #5A6474); }
.sam-install-text strong { color: var(--sam-ink, #0F1B2D); }
.sam-install-text > strong { font-size: 15px; }
.sam button.sam-install-go { flex: none; min-height: 40px; padding: 0 18px; }
.sam button.sam-install-go[hidden] { display: none; }
.sam button.sam-install-x { flex: none; width: 40px; height: 40px; border: 0; background: transparent; color: var(--sam-muted, #5A6474) !important; font-size: 24px; line-height: 1; border-radius: 10px; cursor: pointer; padding: 0; }
.sam button.sam-install-x:hover { background: #F0F2F5; }
@media (max-width: 480px) { .sam-install { flex-wrap: wrap; } .sam-install-text { flex-basis: calc(100% - 104px); } .sam button.sam-install-go { order: 3; width: 100%; } }

/* Energy: day and night graph, report (1.75) */
.sam-dn-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; font-size: 14px; color: var(--sam-ink-2, #3E4858); }
.sam-dn-key strong { color: var(--sam-ink, #0F1B2D); font-variant-numeric: tabular-nums; }
.sam-dn-swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.sam-dn-swatch.is-day { background: #E0A030; }
.sam-dn-swatch.is-night { background: #3B66B0; }
.sam-bars .sam-dn-day { fill: #E0A030; }
.sam-bars .sam-dn-night { fill: #3B66B0; }
.sam-bars .sam-bar:hover .sam-dn-day { fill: #C5881F; }
.sam-bars .sam-bar:hover .sam-dn-night { fill: #2E5290; }
.sam-rep-box { background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius, 14px); padding: 18px 20px; margin: 0 0 16px; }
.sam-rep-box > h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.sam-rep-box > p { margin: 0 0 12px; color: var(--sam-ink-2, #3E4858); font-size: 14px; }
.sam-rep-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sam-rep-link input { flex: 1 1 280px; min-width: 0; }
.sam .sam-rep-input, .sam-rep-link input { height: 48px; padding: 0 12px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 10px; font-size: 16px; background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D); max-width: 100%; }
.sam-rep-dates { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.sam-rep-dates label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.sam-rep-choice { display: block; margin: 0 0 8px; font-size: 15px; }
.sam-rep-sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; margin: 0 0 4px; }
.sam-rep-site { margin: 0; padding: 12px 14px; border: 1px solid var(--sam-line, #E3E6EB); border-radius: 10px; min-width: 0; }
.sam-rep-site legend { padding: 0 6px; font-weight: 600; font-size: 15px; }
.sam-rep-site label { display: block; padding: 4px 0; font-size: 14px; }
.sam-rep-site small { color: var(--sam-muted, #5A6474); }
.sam-rep-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.sam-rep-controls .sam-seg { flex-wrap: wrap; }
.sam .sam-seg button { padding: 8px 14px; border: 0; border-radius: 8px; background: none; color: var(--sam-muted, #5A6474); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sam .sam-seg button.is-active { background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D); box-shadow: 0 1px 2px rgba(15, 27, 45, 0.12); }
.sam-rep-filter summary { cursor: pointer; color: var(--sam-accent, #0B6E6E); font-weight: 600; margin-bottom: 8px; }
.sam-rep-section { margin-top: 24px; }
.sam-rep-kind { margin: 20px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--sam-line, #E3E6EB); font-size: 16px; font-weight: 600; }
.sam-rep-pick-kind { margin: 10px 0 2px; color: var(--sam-muted, #5A6474); font-size: 13px; font-weight: 600; }
.sam-rep-pick-kind:first-of-type { margin-top: 0; }
.sam-rep-note { margin: 0 0 8px; color: var(--sam-muted, #5A6474); font-size: 13px; }
.sam-chart-compare { margin: 10px 0 0; font-size: 15px; font-weight: 700; color: var(--sam-ink-2, #3E4858); }
.sam-chart-compare.is-up { color: #A1241C; }
.sam-chart-compare.is-down { color: #0A6B32; }
.sam-chart-compare.is-none { font-weight: 400; color: var(--sam-muted, #5A6474); }
.sam-chart-key { margin: 2px 0 0; font-size: 13px; color: var(--sam-muted, #5A6474); }
.sam-chart-key i { display: inline-block; width: 18px; height: 3px; margin-right: 6px; vertical-align: middle; background: #D9822B; }
.sam-chart-peak { margin: 2px 0 0; font-size: 13px; color: var(--sam-ink-2, #3E4858); }
.sam-chart-cost { margin: 10px 0 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sam-chart-cost.is-none { color: var(--sam-muted, #5A6474); font-weight: 400; }
.sam-chart-water .sam-dn-swatch.is-day { background: #3B66B0; }
.sam-chart-water .sam-dn-swatch.is-night { background: #E0A030; }
/* 1.109.1: electricity supply graph – grid import, solar, CHP. */
.sam-bars .sam-sup-import, .sam-dn-swatch.sam-sup-import { fill: #3B66B0; background: #3B66B0; }
.sam-bars .sam-sup-solar, .sam-dn-swatch.sam-sup-solar { fill: #E0A030; background: #E0A030; }
.sam-bars .sam-sup-chp, .sam-dn-swatch.sam-sup-chp { fill: #2E9E6B; background: #2E9E6B; }
.sam-bars .sam-bar:hover .sam-sup-import { fill: #2E5290; }
.sam-bars .sam-bar:hover .sam-sup-solar { fill: #C5881F; }
.sam-bars .sam-bar:hover .sam-sup-chp { fill: #237A52; }
.sam-chart-note { margin: 8px 0 0; font-size: 13px; color: var(--sam-muted, #5A6474); }

.sam-chart-water .sam-bars .sam-dn-day { fill: #3B66B0; }
.sam-chart-water .sam-bars .sam-dn-night { fill: #E0A030; }
.sam-chart-water .sam-bars .sam-bar:hover .sam-dn-day { fill: #2E5290; }
.sam-chart-water .sam-bars .sam-bar:hover .sam-dn-night { fill: #C5881F; }
.sam-rep-meter { margin-bottom: 16px; }
.sam-rep-loading { opacity: 0.5; transition: opacity 0.15s; }
.sam-chp .sam-chp-check { grid-column: 1 / -1; margin: 0; font-weight: 500; }
.sam-chp-check p { margin: 0 0 8px; }
.sam-chp-check ul { margin: 0 0 8px; padding-left: 20px; }
.sam-chp-checkbtns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sam .sam-chp-checkbtns button.sam-btn.sam-btn-ghost { background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D) !important; border: 1px solid var(--sam-line-strong, #D5DAE1); text-decoration: none; }
.sam-rep-meter { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.sam-rep-tabs { margin-bottom: 16px; }
.sam-rep-logos { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; }
.sam-rep-logos img[hidden], .sam-rep-site[hidden], .sam-rep-section[hidden] { display: none; }
.sam-cap-crumb { margin: 0 0 4px; font-size: 14px; }
.sam-cap-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sam-cap-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; margin: 16px 0 10px; }
.sam-cap-tile { display: flex; flex-direction: column; gap: 4px; justify-content: space-between; padding: 12px 14px; background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: 10px; }
.sam-cap-tile span { color: var(--sam-muted, #5A6474); font-size: 13px; }
.sam-cap-tile strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.sam-cap-tile.is-apart { background: var(--sam-subtle, #F7F8FA); }
.sam-cap-tile.is-apart strong { font-size: 17px; font-weight: 600; }
.sam-cap-note { margin: 0 0 14px; color: var(--sam-muted, #5A6474); font-size: 14px; }
.sam-cap .sam-cap-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sam-cap-desc { color: var(--sam-muted, #5A6474); font-size: 14px; }
.sam .sam-cap-table { min-width: 720px; }
.sam .sam-cap-running { min-width: 980px; }
.sam .sam-cap-edit { min-width: 1120px; }
.sam-cap-table tfoot th, .sam-cap-table tfoot td, .sam-cap-row-total th, .sam-cap-row-total td { font-weight: 700; background: #EEF1F5; }
.sam-cap-row-section th, .sam-cap-row-section td { font-weight: 600; background: var(--sam-subtle, #F7F8FA); }
.sam-cap-table tr.is-open td { background: var(--sam-subtle, #F7F8FA); }
.sam .sam-cap-input { width: 100%; min-width: 0; box-sizing: border-box; min-height: 40px; padding: 6px 8px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 8px; background: var(--sam-surface, #FFFFFF); font-size: 14px; }
.sam .sam-cap-money { text-align: right; min-width: 96px; font-variant-numeric: tabular-nums; }
.sam .sam-cap-input:disabled { background: #EEF1F5; }
.sam .sam-cap-input[hidden] { display: none; }
.sam .sam-cap-order { width: 72px; }
.sam select.sam-cap-input + select.sam-cap-input { margin-top: 6px; }
.sam button.sam-cap-remove { padding: 4px 0; background: none; border: 0; color: #B42318; font-size: 13px; cursor: pointer; text-decoration: underline; }
.sam-cap-section { margin-bottom: 20px; }
.sam-cap-sechead { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.sam-cap-sechead label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; font-size: 13px; font-weight: 600; }
.sam-cap-sechead label:has(.sam-cap-order) { flex: 0 0 auto; }
.sam-cap-secfoot { margin: 10px 0 4px; }
.sam-cap-vact form { margin: 0; }
.sam-cap-new { display: grid; gap: 16px; margin-top: 20px; max-width: 560px; }
.sam-cap-history { margin-top: 16px; }
.sam-cap-history summary { cursor: pointer; color: var(--sam-accent, #0B6E6E); font-weight: 600; }
.sam-cap-history ul { margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; }
.sam-cap-history li { padding: 5px 0; border-bottom: 1px solid var(--sam-line, #E3E6EB); }
.sam-cap-history li span { color: var(--sam-muted, #5A6474); font-size: 13px; }
.sam-cap-secdel { margin: 12px 0 0; }
.sam button.sam-cap-default { position: absolute; left: -9999px; width: 1px; height: 1px; padding: 0; overflow: hidden; }
.sam .sam-cap-lines td:nth-child(2) .sam-cap-input { min-width: 140px; }
.sam .sam-cap-lines td:nth-child(3) .sam-cap-input { min-width: 200px; }
.sam .sam-cap-lines td:nth-child(6) .sam-cap-input { min-width: 150px; }
.sam .sam-cap-lines td:nth-child(7) .sam-cap-input { min-width: 150px; }
.sam .sam-cap-lines th, .sam .sam-cap-lines td { padding-left: 6px; padding-right: 6px; }
.sam-cap-types { white-space: nowrap; font-size: 13px; }
.sam-cap-types label { display: block; padding: 2px 0; }
.sam-cap-diff.is-over { color: #B42318; font-weight: 600; }
.sam-cap-diff.is-under { color: #17663A; font-weight: 600; }
.sam-cap-sechead label.sam-cap-budget { flex: 0 0 150px; }
.sam-cap-fixed { display: block; padding: 10px 0; font-weight: 400; font-size: 14px; font-variant-numeric: tabular-nums; }
.sam-cap-missing-note { margin: 0 0 14px; padding: 12px 14px; background: #FFF4DB; border: 1px solid #E0A030; border-radius: 10px; color: var(--sam-ink, #0F1B2D); font-size: 15px; }
.sam-cap-table tr.is-missing td { background: #FFF4DB; }
.sam-cap-missing { color: #7A4F00; font-weight: 600; font-size: 13px; }
.sam-cap-progbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.sam-cap-progbar .sam-cap-note { margin: 0; flex: 1 1 280px; }
.sam-cap-taskbox { margin-top: 20px; }
.sam-cap-taskgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.sam-cap-taskgrid label[hidden] { display: none; }
.sam-cap-mstick { display: block; margin: 12px 0; font-size: 15px; }
.sam .sam-cap-taskbox select, .sam .sam-cap-taskbox textarea { width: 100%; box-sizing: border-box; min-height: 48px; padding: 8px 12px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 10px; background: var(--sam-surface, #FFFFFF); font-size: 16px; }
.sam-cap-docs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 2px; }
.sam button.sam-cap-doc, .sam a.sam-cap-doc { display: inline-block; padding: 4px 10px; border: 1px solid var(--sam-accent, #0B6E6E); border-radius: 999px; background: var(--sam-surface, #FFFFFF); color: var(--sam-accent, #0B6E6E); font-size: 13px; font-weight: 600; line-height: 1.3; text-decoration: none; white-space: nowrap; cursor: pointer; }
.sam button.sam-cap-doc:hover, .sam a.sam-cap-doc:hover { background: var(--sam-accent, #0B6E6E); color: #FFFFFF; }
.sam button.sam-cap-doclink { padding: 0; border: 0; background: none; color: var(--sam-accent, #0B6E6E); font: inherit; font-weight: 600; text-align: left; text-decoration: underline; cursor: pointer; }
.sam-cap-seedown { color: var(--sam-muted, #5A6474); font-size: 13px; }
dialog.sam-cap-viewer { width: min(1100px, calc(100vw - 24px)); height: calc(100vh - 24px); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 12px; overflow: hidden; }
dialog.sam-cap-viewer::backdrop { background: rgba(15, 27, 45, .6); }
dialog.sam-cap-viewer iframe { display: block; width: 100%; height: 100%; border: 0; }
.sam-cap-vact form + form { margin-top: 4px; }
.sam .sam-cap-taskbox select { font-size: 16px; }
.sam-cap-docgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.sam-cap-docgrid label { min-width: 0; }
.sam .sam-cap-docgrid input, .sam .sam-cap-docgrid select { display: block; width: 100%; height: 48px; min-height: 48px; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 10px; background: var(--sam-surface, #FFFFFF); font-size: 16px; }
.sam .sam-cap-docgrid input[type="file"] { padding: 8px 12px; line-height: 30px; }
.sam .sam-cap-docgrid input[type="file"]::file-selector-button { vertical-align: middle; margin-right: 10px; }
@media (max-width: 600px) { .sam-cap-docgrid { grid-template-columns: minmax(0, 1fr); } }
.sam .sam-cap-table select[name="kind"] { min-width: 150px; }
.sam-tile-today { margin: -4px 0 6px; font-size: 14px; font-weight: 600; color: var(--sam-ink-2, #3E4858); }
.sam-bms-klines { display: flex; flex-direction: column; gap: 2px; }
.sam-bms-kline { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sam-bms-kline.is-critical { color: #B91C1C; }
.sam-bms-kline.is-major { color: #B45309; }
.sam-bms-kline.is-minor { color: #1D4ED8; }
.sam-bms-kline.is-warning { color: #6D28D9; }
.sam-bms-kline.is-info { color: #0B6E6E; }
.sam-bms-kline.is-unknown { color: var(--sam-muted, #5A6474); }

/* Edit meter readings */
.sam-en-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sam-rd-pick { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 16px 0; }
.sam-rd-pick label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.sam-rd-table td { vertical-align: middle; }
.sam-rd-table tr.is-editing td { background: var(--sam-accent-soft, #DDF1EF); }
.sam-rd-table .sam-rep-input { width: 100%; min-width: 150px; }
.sam-rd-actions { white-space: nowrap; text-align: right; }
.sam-rd-actions form { display: inline-block; margin: 0 0 0 6px; }
.sam button.sam-btn.sam-rd-del { background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-input-line, #C9CFD8); color: #B3261E !important; }
.sam-rd-unit { text-transform: none; }
.sam-table td.sam-rd-drop { color: #B3261E; font-weight: 600; }
.sam-rd-note { margin-top: 12px; }

/* Capital Projects: variances and document categories */
.sam-cap-varnote { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; color: #7A4F00; }
.sam a.sam-cap-varadd { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; white-space: nowrap; }
.sam-cap-doctabs { margin-top: 12px; }
.sam-cap-catbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.sam-cap-catform { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sam-cap-catform label { font-size: 14px; font-weight: 600; }
.sam .sam-cap-catform .sam-cap-input { width: 240px; max-width: 100%; }

/* Notifications box on the dashboard */
.sam-push [data-sam-push-result]:empty { display: none; }
.sam-push [data-sam-push-result] { font-weight: 600; color: var(--sam-ink, #0F1B2D); }
.sam button.sam-install-go.sam-btn-ghost { color: var(--sam-ink, #0F1B2D) !important; }

/* SAM Settings: the sidebar link (in the look of a group heading) and the screen */
.sam-nav a.sam-nav-settings { margin-top: 6px; padding: 10px 12px; color: var(--sam-side-muted, #8C98AA); font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; }
.sam-nav a.sam-nav-settings:hover, .sam-nav a.sam-nav-settings.is-active { color: var(--sam-side-text, #FFFFFF); }
.sam-settings-menu section { margin-top: 20px; }
.sam-settings-menu > .sam-cards { margin-top: 14px; }
.sam-settings-menu .sam-en-h2 { margin: 0 0 10px; }
.sam-settings-menu .sam-cards-quick { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.sam-settings-menu .sam-cards-quick .sam-card-desc { display: block; }
.sam-settings-menu .sam-cards-quick .sam-card-icon { grid-row: span 2; width: 36px; height: 36px; }

/* Capital Projects: rename (1.93) */
.sam-cap-manage { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 20px; margin: 8px 0 0; }
.sam-cap-rename { margin: 0; }
.sam-cap-rename[open] { flex-basis: 100%; order: 2; }
.sam-cap-rename summary { cursor: pointer; font-size: 14px; color: var(--sam-accent, #0B6E6E); font-weight: 600; }
.sam-cap-rename-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.sam .sam-cap-rename-input { box-sizing: border-box; height: 48px; width: min(360px, 100%); padding: 0 12px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 10px; font-size: 16px; background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D); }
.sam .sam-cap-rename-form button.sam-btn { min-height: 48px; }
.sam-cap-archform { display: inline-block; margin: 0; }
.sam .sam-cap-archbtn { padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--sam-accent, #0B6E6E); text-decoration: underline; cursor: pointer; }
.sam-cap-archfilter { margin: 0 0 12px; font-size: 14px; }
.sam-cap-archfilter label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.sam-cap-archtag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--sam-fill, #EEF0F3); color: var(--sam-muted, #5A6474); font-size: 12px; font-weight: 700; vertical-align: middle; }
.sam-table tr.is-archived td { color: var(--sam-muted, #5A6474); }
/* 1.95.6: SAM's logo on the left of the open pages' header bar, the staff button on the right. */
.sam-public-top { justify-content: space-between; }
.sam-public-top .sam-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: var(--sam-ink, #0F1B2D); text-decoration: none; box-shadow: none; }
.sam-public-top .sam-brand-logo { display: block; height: var(--sam-logo-h, 36px); width: auto; max-width: 220px; object-fit: contain; }
.sam-public-top .sam-brand-mark { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 6px; border-radius: 10px; background: var(--sam-accent, #0B6E6E); color: #FFFFFF; font-weight: 700; }
.sam-public-top .sam-brand-name { font-weight: 600; font-size: 16px; }
@media (max-width: 480px) { .sam-public-top .sam-brand-logo { max-width: 150px; height: 30px; } .sam-public-top .sam-brand-name { display: none; } }

/*
 * Sidebar links with icons (1.95.21), and the Light sidebar style (Appearance → Sidebar style, the default): pale grey,
 * dark writing, an icon by each link, the open page filled in the main colour, groups split by a line.
 */
.sam-nav a { display: flex; align-items: center; gap: 12px; }
.sam-nav-ic { flex: 0 0 20px; width: 20px; height: 20px; opacity: .85; }
.sam-nav a.is-active .sam-nav-ic { opacity: 1; }
.sam-nav-tx { min-width: 0; }
.sam-nav-group-items a, .sam-nav-group.is-open .sam-nav-group-items a { padding-left: 12px; }
.sam-nav a.sam-nav-settings { display: flex; }

body.sam-side-light .sam-side {
	--sam-side: #F2F3F5; --sam-side-text: #0F1B2D; --sam-side-link: #2B3442; --sam-side-muted: #6B7585;
	--sam-side-hover: #E3E6EA; --sam-side-active: #D9DDE3; --sam-side-focus: var(--sam-accent, #0B6E6E);
	border-right: 1px solid #DDE1E6;
}
body.sam-side-light .sam-nav { gap: 4px; }
body.sam-side-light .sam-nav a { padding: 11px 14px; border-radius: 10px; font-size: 15.5px; font-weight: 600; color: var(--sam-side-link); }
body.sam-side-light .sam-nav a:hover { background: var(--sam-side-hover); color: var(--sam-side-text); }
body.sam-side-light .sam-nav a.is-active,
body.sam-side-light .sam-nav-group.is-open .sam-nav-group-items a.is-active { background: var(--sam-accent, #0B6E6E); color: #FFFFFF; box-shadow: 0 1px 2px rgba(15, 27, 45, 0.12); }
body.sam-side-light .sam-nav a:focus-visible { outline-color: var(--sam-accent, #0B6E6E); }
/* Groups: a line above, the group name small and grey, its links in line with the rest (no panel). */
body.sam-side-light .sam-nav-group,
body.sam-side-light .sam-nav-group.is-open { background: none; padding-bottom: 0; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sam-line-strong, #D5DAE1); border-radius: 0; }
body.sam-side-light .sam-nav-group-btn,
body.sam-side-light .sam-nav-group.is-open .sam-nav-group-btn { background: none; box-shadow: none; border-radius: 8px; padding: 6px 14px; color: var(--sam-side-muted); font-size: 11.5px; }
body.sam-side-light .sam-nav-group-btn:hover { background: var(--sam-side-hover); color: var(--sam-side-text); }
body.sam-side-light .sam-nav-group.has-active .sam-nav-group-btn { color: var(--sam-accent, #0B6E6E); }
body.sam-side-light .sam-nav-group.is-open .sam-nav-group-items { margin: 2px 0 0; padding-left: 0; border-left: 0; }
body.sam-side-light .sam-nav a.sam-nav-settings { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--sam-line-strong, #D5DAE1); border-radius: 0 0 10px 10px; text-transform: none; letter-spacing: 0; font-size: 15.5px; color: var(--sam-side-link); }
body.sam-side-light .sam-nav a.sam-nav-settings.is-active { border-radius: 10px; }
body.sam-side-light .sam-brand { color: var(--sam-side-text); }
body.sam-side-light .sam-side-version { color: var(--sam-side-muted); }
@media (max-width: 899px) {
	body.sam-side-light .sam-side { border-right: 0; border-bottom: 1px solid #DDE1E6; }
	body.sam-side-light .sam-menu-btn { background: var(--sam-surface, #FFFFFF); border-color: var(--sam-line-strong, #D5DAE1); color: var(--sam-side-text); }
	body.sam-side-light.sam-menu-open .sam-side { border-bottom: 0; }
}
@media (min-width: 900px) { body.sam-side-light .sam-side { flex: 0 0 264px; } }

/*
 * 1.98.3: smaller menu writing, every group always open (no folding), each group under a small heading with a line
 * above it. Both sidebar styles.
 */
.sam-nav { gap: 1px; }
.sam-nav a, body.sam-side-light .sam-nav a { padding: 7px 12px; font-size: 13.5px; gap: 10px; border-radius: 8px; }
.sam-nav-ic { flex-basis: 17px; width: 17px; height: 17px; }
.sam-nav-group-items a, .sam-nav-group.is-open .sam-nav-group-items a { padding-left: 12px; }
.sam-nav-group, .sam-nav-group.is-open,
body.sam-side-light .sam-nav-group, body.sam-side-light .sam-nav-group.is-open {
	background: none; margin-top: 8px; padding: 8px 0 0; border-top: 1px solid var(--sam-side-active, #2A3A52); border-radius: 0;
}
body.sam-side-light .sam-nav-group, body.sam-side-light .sam-nav-group.is-open { border-top-color: var(--sam-line-strong, #D5DAE1); }
.sam-nav-group .sam-nav-group-items, .sam-nav-group.is-open .sam-nav-group-items,
.sam-nav-group:not(.is-open) .sam-nav-group-items { display: flex; margin: 0; padding-left: 0; border-left: 0; }
.sam-nav-head { padding: 4px 12px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--sam-side-muted, #8C98AA); }
.sam-nav-group.has-active .sam-nav-head { color: var(--sam-side-focus, #5FC4C4); }
body.sam-side-light .sam-nav-group.has-active .sam-nav-head { color: var(--sam-accent, #0B6E6E); }
.sam-nav a.sam-nav-settings, body.sam-side-light .sam-nav a.sam-nav-settings { margin-top: 8px; padding: 7px 12px; font-size: 13.5px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--sam-side-link, #C6CEDA); }
body.sam-side-light .sam-nav a.sam-nav-settings { font-weight: 600; color: var(--sam-side-link); border-top: 0; border-radius: 8px; position: relative; }
.sam-nav a.sam-nav-settings::before { content: ""; position: absolute; left: 0; right: 0; top: -5px; border-top: 1px solid var(--sam-side-active, #2A3A52); }
body.sam-side-light .sam-nav a.sam-nav-settings::before { border-top-color: var(--sam-line-strong, #D5DAE1); }
.sam-nav a.sam-nav-settings { position: relative; }
.sam-nav-group.is-open .sam-nav-group-items a.is-active { box-shadow: none; }

/*
 * Header bar (1.98.4, the user's wish): the Sidebar colour (dark blue by default) with the logo, right across the top
 * of the page above the sidebar and the page. The site logo sits on a white tile so dark logos still show.
 * Phones: the bar with the logo and Menu button takes the same colour, so the two read as one header.
 */
.sam-top { background: var(--sam-side, #0F1B2D); color: var(--sam-side-text, #FFFFFF); border-bottom: 0; padding: 12px 28px; min-height: 72px; box-sizing: border-box; gap: 12px 24px; }
.sam-top-brand { flex: 0 0 auto; margin-right: auto; }
.sam-top-brand .sam-brand { padding: 0; color: var(--sam-side-text, #FFFFFF); }
.sam-top-brand .sam-brand-logo { height: calc(var(--sam-logo-h, 36px) * 1.15); max-width: 240px; }
.sam-top .sam-top-site { flex: 0 1 auto; }
.sam-top .sam-site-logo { height: 40px; padding: 4px 8px; border-radius: 8px; background: var(--sam-surface, #FFFFFF); box-sizing: content-box; }
.sam-top .sam-switch label { color: var(--sam-side-muted, #8C98AA); }
.sam-top .sam-switch select { border-color: transparent; }
.sam-top .sam-switch-one { color: var(--sam-side-text, #FFFFFF); }
.sam-top .sam-me { color: var(--sam-side-text, #FFFFFF); }
.sam-top .sam-avatar { background: rgba(255, 255, 255, 0.16); color: var(--sam-side-text, #FFFFFF); }
.sam-top .sam-me a { color: var(--sam-side-text, #FFFFFF); text-decoration: underline; text-underline-offset: 3px; opacity: .9; }
.sam-top .sam-me a:hover { opacity: 1; }
/* The sidebar's own logo is only needed on phones, where the bar holds the Menu button. */
.sam-side-head .sam-brand-bar { display: none; }
@media (min-width: 900px) {
	.sam-app { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: stretch; }
	body.sam-side-light .sam-app { grid-template-columns: 264px minmax(0, 1fr); }
	.sam-body { display: contents; }
	.sam-top { grid-column: 1 / -1; grid-row: 1; }
	.sam-side { grid-column: 1; grid-row: 2; }
	.sam-main { grid-column: 2; grid-row: 2; }
	.sam-side-head { display: none; }
	.sam-side { padding-top: 16px; }
}
@media (max-width: 899px) {
	/* One coloured header on phones: the bar (logo + Menu) then the header (site and who's signed in). */
	.sam-top-brand { display: none; }
	body:not(.sam-menu-open) .sam-side { background: var(--sam-side-bar, #0F1B2D); border-bottom: 0; }
	body:not(.sam-menu-open) .sam-side-head .sam-brand { display: none; }
	body:not(.sam-menu-open) .sam-side-head .sam-brand-bar { display: flex; color: #FFFFFF; }
	body:not(.sam-menu-open) .sam-menu-btn,
	body.sam-side-light:not(.sam-menu-open) .sam-menu-btn { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
	.sam-top { min-height: 0; padding-top: 4px; }
}
@media (max-width: 899px) {
	.sam-app { align-content: flex-start; }
	.sam-top .sam-top-site { flex: 1 1 100%; min-width: 0; }
	.sam-top .sam-site-logo { height: 30px; }
	.sam-top .sam-switch { flex: 1 1 auto; min-width: 0; }
	.sam-top .sam-switch select { width: 100%; min-width: 0; }
	.sam-top .sam-me { font-size: 14px; }
}
/* Menu headings in the main colour (1.98.4, the user's wish) – on the coloured sidebar a lighter teal so it reads. */
body.sam-side-light .sam-nav-head, body.sam-side-light .sam-nav-group.has-active .sam-nav-head { color: var(--sam-accent, #0B6E6E); }
body:not(.sam-side-light) .sam-nav-head { color: var(--sam-side-focus, #5FC4C4); }

/*
 * Header bar on the open pages and sign-in screens (1.98.5): the same dark blue bar as the staff pages – the Sidebar
 * colour with the sidebar logo – and the Staff sign in / Staff dashboard button as a light outlined button.
 */
.sam-login-top.sam-bar-top, body.login .sam-login-top.sam-bar-top { background: var(--sam-side-bar, var(--sam-side, #0F1B2D)); border-bottom: 0; box-shadow: none; min-height: 72px; padding: 12px 28px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.sam-bar-top .sam-brand, .sam-bar-top .sam-brand:hover { color: #FFFFFF; text-decoration: none; }
.sam-bar-top .sam-brand-logo { height: calc(var(--sam-logo-h, 36px) * 1.15); max-width: 240px; }
.sam-bar-top .sam-brand-name { color: #FFFFFF; }
.sam-bar-top .sam-btn.sam-btn-dark, .sam .sam-bar-top .sam-btn-dark { background: transparent; border: 1px solid rgba(255, 255, 255, 0.55); color: #FFFFFF !important; }
.sam-bar-top .sam-btn.sam-btn-dark:hover { background: rgba(255, 255, 255, 0.12); }
@media (max-width: 600px) { .sam-login-top.sam-bar-top { padding: 10px 16px; min-height: 64px; } .sam-bar-top .sam-brand-logo { max-width: 170px; height: 34px; } }

/* Meter alerts (1.100.2) */
.sam-en-alert { margin: 0 0 22px; padding: 18px 22px; background: #FFF7E6; border: 1px solid #F5C26B; border-left: 5px solid #E08A00; border-radius: var(--sam-radius, 14px); color: #3D2A00; }
.sam-en-alert h2 { margin: 0 0 6px; font-size: 17px; color: #7A4600; }
.sam-en-alert p { margin: 0 0 10px; line-height: 1.5; }
.sam-en-alert ul { margin: 0 0 10px; padding: 0; list-style: none; }
.sam-en-alert li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-top: 1px solid #F3D9A6; }
.sam-en-alert li > span { flex: 1 1 300px; min-width: 0; line-height: 1.45; }
.sam-en-alert li form { margin: 0; }
.sam-en-alert li a { font-weight: 600; color: #7A4600; }
.sam .sam-en-alert button.sam-en-alert-btn { min-height: 40px; padding: 0 14px; border: 1px solid #E0A030; border-radius: 10px; background: var(--sam-surface, #FFFFFF); color: #7A4600; font: inherit; font-weight: 600; cursor: pointer; }
.sam .sam-en-alert button.sam-en-alert-btn:hover { background: #FFF0D1; }
.sam-en-alert-ok { display: block; margin-top: 2px; font-size: 13px; color: var(--sam-muted, #5A6474); }
.sam-en-alert .sam-en-alert-note { margin: 0; font-size: 13px; color: #6B5320; }
/* 2.1.13: checked warnings folded into a small box. */
.sam-en-alert-done { margin: 0 0 22px; padding: 0 18px; background: #FFFBF2; border: 1px solid #F3D9A6; border-left: 4px solid #E0A030; border-radius: 12px; color: #3D2A00; }
.sam-en-alert-done > summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 14.5px; color: #7A4600; }
.sam-en-alert-done > summary span { font-weight: 400; color: #6B5320; }
.sam-en-alert-done ul { margin: 0 0 8px; padding: 0; list-style: none; }
.sam-en-alert-done li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0; border-top: 1px solid #F3D9A6; line-height: 1.45; }
.sam-en-alert-done .sam-en-alert-note { margin: 0 0 12px; font-size: 13px; color: #6B5320; }
/* Choose what to be notified about (1.100.3) */
.sam-push-prefs { margin-top: 6px; }
.sam-push-prefs[hidden] { display: none; }
.sam-push-prefs summary { cursor: pointer; font-weight: 600; color: var(--sam-accent, #0B6E6E); min-height: 32px; display: flex; align-items: center; }
.sam-push-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 6px 18px; margin: 6px 0 4px; }
.sam-push-kinds label { display: flex; align-items: center; gap: 8px; min-height: 32px; color: var(--sam-ink, #0F1B2D); font-size: 14px; cursor: pointer; }
.sam-push-kinds input { width: 18px; height: 18px; flex: none; accent-color: var(--sam-accent, #0B6E6E); }
.sam-push-note { font-size: 13px; color: var(--sam-muted, #5A6474); }
.sam button.sam-install-go.sam-btn-ghost { background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line-strong, #D5DAE1); }
.sam-push button.sam-install-x { align-self: flex-start; }

/* My profile (1.100.4): the name in the header bar opens it */
.sam-me a.sam-me-link, .sam-top .sam-me a.sam-me-link { display: inline-flex; align-items: center; gap: 12px; color: inherit; font-size: inherit; font-weight: inherit; text-decoration: none; opacity: 1; border-radius: 999px; padding: 2px 8px 2px 2px; }
.sam-me a.sam-me-link:hover .sam-me-name, .sam-me a.sam-me-link:focus-visible .sam-me-name { text-decoration: underline; text-underline-offset: 3px; }
.sam-pf { max-width: 860px; }
.sam-pf-form { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.sam-pf-card { padding: 22px 24px; background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius, 14px); }
.sam-pf > .sam-pf-card { margin-bottom: 20px; }
.sam-pf-card h2 { margin: 0 0 12px; font-size: 18px; }
.sam-pf-card p { margin: 0 0 12px; line-height: 1.5; }
.sam-pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px 20px; }
.sam-pf-hint { color: var(--sam-muted, #5A6474); font-size: 14px; }
.sam-pf-card .sam-pf-hint:last-child { margin-bottom: 0; }
.sam-pf-ticks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 4px 20px; }
.sam-pf-ticks label { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.sam-pf-ticks input { width: 20px; height: 20px; flex: none; accent-color: var(--sam-accent, #0B6E6E); }
.sam-pf-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to bottom, rgba(245, 246, 248, 0), var(--sam-page, #F5F6F8) 35%); z-index: 2; }
.sam-pf-emailform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.sam-pf-emailform .sam-field { flex: 1 1 280px; margin: 0; }
.sam-pf-emailform input[type=email] { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--sam-input-line, #C9CFD8); border-radius: 10px; font-size: 16px; box-sizing: border-box; }
.sam-pf-pending { margin: 0 0 16px; padding: 14px 16px; background: #FFF7E6; border: 1px solid #F5C26B; border-radius: 12px; }
.sam-pf-pending p { margin: 0 0 10px; }
.sam-pf-inline { display: inline-block; margin: 0 8px 0 0; }
.sam-pf-test { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 0; } /* 1.120: Send a test email / notification. */
.sam-pf-clear { margin-top: 14px; }
.sam-pf button.sam-btn.sam-btn-ghost { background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D) !important; border: 1px solid var(--sam-line-strong, #D5DAE1); }
.sam-pf .sam-hs-flash { margin: 0 0 18px; }
.sam-pf-note { padding: 10px 14px; background: #EEF6F6; border-left: 4px solid var(--sam-accent, #0B6E6E); border-radius: 8px; }
/* Capital document categories: rename or delete (1.100.11) */
.sam-cap-catedit { margin: 0 0 18px; padding: 12px 16px; background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: 12px; }
.sam-cap-catedit summary { cursor: pointer; font-weight: 600; color: var(--sam-accent, #0B6E6E); min-height: 32px; display: flex; align-items: center; }
.sam-cap-catedit p { margin: 8px 0 12px; }
.sam-cap-catedit .sam-cap-catform { margin: 0 0 12px; }
.sam-cap-catedit button.sam-btn.sam-btn-ghost { background: var(--sam-surface, #FFFFFF); color: var(--sam-ink, #0F1B2D) !important; border: 1px solid var(--sam-line-strong, #D5DAE1); }
/* Running budget (1.100.12, the user's wish): clearer title rows – a pale band in the main colour with a strong left edge, bold
   larger writing and a gap above each title; no Totals row (the totals are in the boxes at the top of the page). */
.sam-cap-running .sam-cap-row-section th, .sam-cap-running .sam-cap-row-section td { background: var(--sam-accent-soft, #DDF1EF); color: var(--sam-accent-ink, #0A4F4F); font-size: 15.5px; font-weight: 700; padding-top: 13px; padding-bottom: 13px; border-bottom: 2px solid var(--sam-accent, #0B6E6E); }
.sam-cap-running .sam-cap-row-section th { box-shadow: inset 5px 0 0 var(--sam-accent, #0B6E6E); padding-left: 18px; letter-spacing: .2px; }
.sam-cap-running tbody + tbody .sam-cap-row-section th, .sam-cap-running tbody + tbody .sam-cap-row-section td { border-top: 22px solid var(--sam-surface, #FFFFFF); }

/* Page headings with room to breathe (1.100.13 – the user found titles, sub-titles and the first box squashed, e.g. on a
   capital project). The same spacing on every SAM page: a gap under the back link, under the title and before the first box. */
.sam-dash-head, .sam-en-head { margin-bottom: 26px; row-gap: 14px; }
.sam .sam-dash-title { margin: 0 0 8px; line-height: 1.22; }
.sam .sam-dash-sub { line-height: 1.5; }
.sam .sam-hs-back, .sam .sam-cap-crumb { margin: 0 0 14px; }
.sam .sam-hs-kicker { margin: 0 0 6px; }
.sam-cap-manage { margin: 14px 0 0; }
.sam-cap-tiles { margin: 0 0 22px; }
.sam-cap .sam-tabs { margin-top: 6px; }
/* The chosen site's logo at the top of the sidebar (1.100.13, the user's choice – no more white box in the header bar). On the
   light sidebar it sits on the pale background; on the coloured one, on a white tile so it can be seen. */
.sam-side-site { padding: 18px 20px 16px; margin: 0 0 6px; border-bottom: 1px solid var(--sam-side-line, rgba(15, 27, 45, 0.1)); }
.sam-side-site-logo { display: block; max-width: 100%; max-height: 72px; width: auto; height: auto; object-fit: contain; }
body:not(.sam-side-light) .sam-side-site-logo { padding: 8px 10px; background: var(--sam-surface, #FFFFFF); border-radius: 10px; box-sizing: border-box; }
@media (max-width: 899px) { .sam-side-site { padding: 14px 16px 12px; } .sam-side-site-logo { max-height: 56px; } }
/* 2.1.16 (the user's phone screenshot): on phones the site logo sits on the dark header bar, so dark lettering vanished – always on a white tile there. */
@media (max-width: 899px) { .sam-side-site-logo { padding: 6px 10px; background: #FFFFFF; border-radius: 10px; box-sizing: border-box; max-height: 60px; } }
/* My Profile: the sidebar choice (1.100.14) */
.sam-pf-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.sam-pf-choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--sam-line, #E3E6EB); border-radius: 12px; cursor: pointer; }
.sam-pf-choice:has(input:checked) { border-color: var(--sam-accent, #0B6E6E); box-shadow: 0 0 0 2px var(--sam-accent-ring, rgba(11, 110, 110, 0.2)); }
.sam-pf-choice input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--sam-accent, #0B6E6E); }
.sam-pf-choice > span { display: flex; flex-direction: column; gap: 2px; }
.sam-pf-choice .sam-pf-hint { font-size: 13px; }

/* Dark colours (1.100.15): chosen per person on My Profile – Dark, or Match my device (dark only while the phone or computer is
   in dark mode). Only SAM's app pages; PDFs, emails, printouts, TV screens and open forms stay light. Signature pads and site
   logos keep a white background. */
body.sam-theme-dark {
	--sam-ink: #E7EBF1; --sam-ink-2: #C7CED9; --sam-muted: #9EA9B8; --sam-faint: #7F8A9A;
	--sam-page: #0E141C; --sam-surface: #172029; --sam-subtle: #1B2530; --sam-subtle-2: #1A232E; --sam-fill: #232D3A;
	--sam-line: #2B3644; --sam-line-soft: #232D39; --sam-line-strong: #384556; --sam-input-line: #56657B;
	--sam-accent-soft: #123A3A; --sam-accent-ink: #8ADBD4; --sam-accent-ring: rgba(95, 196, 196, 0.35); --sam-link: #6FD0C8; --sam-link-hover: #A3E4DE; --sam-accent: var(--sam-accent-dm, #16857F);
	color-scheme: dark;
}
body.sam-theme-dark.sam-side-light .sam-side, body.sam-theme-dark.sam-side-light .sam-side {
	--sam-side: #121A23; --sam-side-text: #E7EBF1; --sam-side-link: #C7CED9; --sam-side-muted: #8C98AA;
	--sam-side-hover: #1D2733; --sam-side-active: #253141; border-right-color: #232D39;
}
body.sam-theme-dark .sam-side-site-logo { padding: 8px 10px; background: #FFFFFF; border-radius: 10px; }
body.sam-theme-dark .sam-ptw-sig canvas, body.sam-theme-dark canvas[data-sig] { background-color: #FFFFFF; }
body.sam-theme-dark img.sam-site-logo, body.sam-theme-dark .sam-pub-logo img { background: #FFFFFF; border-radius: 6px; }
body.sam-theme-dark .sam-hs-flash { background: #123A3A; color: #CDEFEC; }
body.sam-theme-dark .sam-hs-flash.is-warn { background: #3A2A10; color: #F7D9A0; }
body.sam-theme-dark .sam-en-alert { background: #2E2412; border-color: #6B5320; color: #F3E3C0; }
body.sam-theme-dark .sam-en-alert h2, body.sam-theme-dark .sam-en-alert li a { color: #F7C870; }
body.sam-theme-dark .sam-en-alert li { border-top-color: #4A3A18; }
body.sam-theme-dark .sam-en-alert .sam-en-alert-note { color: #C9B27C; }
body.sam-theme-dark .sam .sam-en-alert button.sam-en-alert-btn { background: #172029; color: #F7C870; border-color: #6B5320; }
body.sam-theme-dark .sam-en-alert-done { background: #241D10; border-color: #4A3A18; border-left-color: #B7832A; color: #F3E3C0; }
body.sam-theme-dark .sam-en-alert-done > summary { color: #F7C870; }
body.sam-theme-dark .sam-en-alert-done > summary span, body.sam-theme-dark .sam-en-alert-done .sam-en-alert-note { color: #C9B27C; }
body.sam-theme-dark .sam-en-alert-done li { border-top-color: #4A3A18; }
body.sam-theme-dark .sam-pf-note, body.sam-theme-dark .sam-pf-pending { background: #1B2530; }
body.sam-theme-dark .sam .sam-btn.sam-btn-ghost, body.sam-theme-dark .sam button.sam-btn.sam-btn-ghost, body.sam-theme-dark .sam a.sam-btn-ghost { background: #172029; color: #E7EBF1 !important; border-color: #384556; }
body.sam-theme-dark .sam-table th { color: #C7CED9; }

/* 1.100.16 – fixes from the user's first look at dark mode: richer status colours, the site list, matrix, logos on white, file boxes. */
body.sam-theme-dark { --sam-tone-teal-soft: color-mix(in srgb, var(--sam-tone-teal-solid, #0B6E6E) 62%, #000000); --sam-tone-teal-ink: color-mix(in srgb, var(--sam-tone-teal-solid, #0B6E6E) 22%, #FFFFFF); --sam-tone-blue-soft: color-mix(in srgb, var(--sam-tone-blue-solid, #1D4ED8) 62%, #000000); --sam-tone-blue-ink: color-mix(in srgb, var(--sam-tone-blue-solid, #1D4ED8) 22%, #FFFFFF); --sam-tone-amber-soft: color-mix(in srgb, var(--sam-tone-amber-solid, #B45309) 62%, #000000); --sam-tone-amber-ink: color-mix(in srgb, var(--sam-tone-amber-solid, #B45309) 22%, #FFFFFF); --sam-tone-grey-soft: color-mix(in srgb, var(--sam-tone-grey-solid, #4A5464) 62%, #000000); --sam-tone-grey-ink: color-mix(in srgb, var(--sam-tone-grey-solid, #4A5464) 22%, #FFFFFF); --sam-tone-green-soft: color-mix(in srgb, var(--sam-tone-green-solid, #15803D) 62%, #000000); --sam-tone-green-ink: color-mix(in srgb, var(--sam-tone-green-solid, #15803D) 22%, #FFFFFF); --sam-tone-purple-soft: color-mix(in srgb, var(--sam-tone-purple-solid, #6D28D9) 62%, #000000); --sam-tone-purple-ink: color-mix(in srgb, var(--sam-tone-purple-solid, #6D28D9) 22%, #FFFFFF); --sam-tone-red-soft: color-mix(in srgb, var(--sam-tone-red-solid, #B91C1C) 62%, #000000); --sam-tone-red-ink: color-mix(in srgb, var(--sam-tone-red-solid, #B91C1C) 22%, #FFFFFF); }
body.sam-theme-dark .sam-rate-chip.is-green, body.sam-theme-dark .sam-doc-type.is-excel, body.sam-theme-dark .sam-hs-chip.is-good, body.sam-theme-dark .sam-hs-a.is-yes, body.sam-theme-dark .sam-pr-state.is-done, body.sam-theme-dark .sam-ra-badge.is-good, body.sam-theme-dark .sam-sf-key.is-ok, body.sam-theme-dark .sam .sam-sf-cald.is-ok, body.sam-theme-dark .sam-cu-totals tr.is-good td, body.sam-theme-dark .sam-cu-totals tr.is-good th { background: #14532D; color: #BBF7D0; }
body.sam-theme-dark .sam-rate-chip.is-red, body.sam-theme-dark .sam-doc-type.is-pdf, body.sam-theme-dark .sam-hs-chip.is-poor, body.sam-theme-dark .sam-hs-a.is-no, body.sam-theme-dark .sam-ptw-problems, body.sam-theme-dark .sam-pr-state.is-overdue, body.sam-theme-dark .sam-ra-badge.is-bad, body.sam-theme-dark .sam-sf-attn li.is-red, body.sam-theme-dark .sam-sf-key.is-miss, body.sam-theme-dark .sam .sam-sf-cald.is-miss, body.sam-theme-dark .sam-sf-allergen td.is-has, body.sam-theme-dark .sam-cashup tr.is-bad td, body.sam-theme-dark .sam-cashup tr.is-bad th { background: #7F1D1D; color: #FECACA; }
body.sam-theme-dark .sam-rate-chip.is-amber, body.sam-theme-dark .sam-notice.is-warn, body.sam-theme-dark .sam-doc-type.is-powerpoint, body.sam-theme-dark .sam-hs-chip.is-fair, body.sam-theme-dark .sam-hs-a.is-blank, body.sam-theme-dark .sam-hsm-sum td.sam-hsm-c.is-due a, body.sam-theme-dark .sam-lad-badge.is-warn, body.sam-theme-dark .sam-ptw-risklist li, body.sam-theme-dark .sam-badge-in_progress, body.sam-theme-dark .sam-formb-tag, body.sam-theme-dark .sam-sf-attn li.is-amber, body.sam-theme-dark .sam-sf-key.is-warn, body.sam-theme-dark .sam .sam-sf-cald.is-warn, body.sam-theme-dark .sam-sf-allergen td.is-may { background: #78350F; color: #FDE68A; }
body.sam-theme-dark .sam-doc-type.is-word, body.sam-theme-dark .sam-hsm-sum td.sam-hsm-c.is-planned a, body.sam-theme-dark .sam-ra-badge.is-review, body.sam-theme-dark .sam-ra-badge.is-draft, body.sam-theme-dark .sam-badge-new { background: #1E3A8A; color: #BFDBFE; }
body.sam-theme-dark select option, body.sam-theme-dark select optgroup { background-color: #172029; color: #E7EBF1; }
body.sam-theme-dark .sam-top .sam-switch select { background-color: #172029; color: #E7EBF1; border-color: #435064; }
/* 1.100.18: the site's theme (BeTheme) makes a clicked drop-down pale blue with !important; keep it dark. */
body.sam-theme-dark select:focus:not(.is-e):not(.is-i), body.sam-theme-dark textarea:focus, body.sam-theme-dark input:focus { background-color: var(--sam-surface, #172029) !important; color: var(--sam-ink, #E7EBF1) !important; }
body.sam-theme-dark td.sam-hsm-c.is-now, body.sam-theme-dark .sam-ra-versions tr.is-here td { background: #16302F; }
/* Matrix pop-up (1.101.1): a lighter panel, a clear edge and a darker page behind, or it blends into the dark page. */
body.sam-theme-dark .sam-hsm-dialog { background: #243140; border-color: #6B7A90; border-top-color: var(--sam-accent); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75); }
body.sam-theme-dark .sam-hsm-dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
body.sam-theme-dark .sam-hsm-x:hover { background: rgba(255, 255, 255, 0.1); }
body.sam-theme-dark .sam .sam-hsm-detail .sam-field input[type="file"] { padding-top: 6px; padding-bottom: 6px; }
/* Matrix (1.100.24): before records started keeps the key's own colours with a faint hatch, like its key swatch; opacity left dark writing on murky colour. */
body.sam-theme-dark td.sam-hsm-c.is-past a { opacity: 1; background-image: repeating-linear-gradient(135deg, rgba(15, 27, 45, 0.14) 0 3px, transparent 3px 6px); }
body.sam-theme-dark td.sam-hsm-c.is-na a, body.sam-theme-dark .sam-hsm-k.is-na { background: #4B5563; color: #E7EBF1; }
body.sam-theme-dark .sam-cap-table tfoot th, body.sam-theme-dark .sam-cap-table tfoot td, body.sam-theme-dark .sam-cap-row-total th, body.sam-theme-dark .sam-cap-row-total td, body.sam-theme-dark .sam .sam-cap-input:disabled { background: #26334A; color: #F2F5F9; }
body.sam-theme-dark .sam-rates-next-note { color: #93C5FD; }
body.sam-theme-dark img.sam-site-logo, body.sam-theme-dark .sam-en-logo { padding: 6px 10px; background: #FFFFFF; border-radius: 8px; box-sizing: content-box; }
body.sam-theme-dark .sam input[type=file], body.sam-theme-dark .sam-pr-docform input[type=file] { border-color: #6B7A90; }
body.sam-theme-dark .sam input[type=file]::file-selector-button { background: #2B3644; color: #E7EBF1; border: 1px solid #56657B; border-radius: 8px; padding: 6px 12px; }
body.sam-theme-dark .sam-bms-raw pre { background: #1B2530; }
body.sam-theme-dark .sam-bmsc-spin { border-color: #384556; border-top-color: var(--sam-accent, #16857F); }
@media (prefers-color-scheme: dark) {
	body.sam-theme-auto {
		--sam-ink: #E7EBF1; --sam-ink-2: #C7CED9; --sam-muted: #9EA9B8; --sam-faint: #7F8A9A;
		--sam-page: #0E141C; --sam-surface: #172029; --sam-subtle: #1B2530; --sam-subtle-2: #1A232E; --sam-fill: #232D3A;
		--sam-line: #2B3644; --sam-line-soft: #232D39; --sam-line-strong: #384556; --sam-input-line: #56657B;
		--sam-accent-soft: #123A3A; --sam-accent-ink: #8ADBD4; --sam-accent-ring: rgba(95, 196, 196, 0.35); --sam-link: #6FD0C8; --sam-link-hover: #A3E4DE; --sam-accent: var(--sam-accent-dm, #16857F);
		color-scheme: dark;
	}
		body.sam-theme-auto.sam-side-light .sam-side, body.sam-theme-auto.sam-side-light .sam-side {
		--sam-side: #121A23; --sam-side-text: #E7EBF1; --sam-side-link: #C7CED9; --sam-side-muted: #8C98AA;
		--sam-side-hover: #1D2733; --sam-side-active: #253141; border-right-color: #232D39;
	}
	body.sam-theme-auto .sam-side-site-logo { padding: 8px 10px; background: #FFFFFF; border-radius: 10px; }
	body.sam-theme-auto .sam-ptw-sig canvas, body.sam-theme-auto canvas[data-sig] { background-color: #FFFFFF; }
	body.sam-theme-auto img.sam-site-logo, body.sam-theme-auto .sam-pub-logo img { background: #FFFFFF; border-radius: 6px; }
	body.sam-theme-auto .sam-hs-flash { background: #123A3A; color: #CDEFEC; }
	body.sam-theme-auto .sam-hs-flash.is-warn { background: #3A2A10; color: #F7D9A0; }
	body.sam-theme-auto .sam-en-alert { background: #2E2412; border-color: #6B5320; color: #F3E3C0; }
	body.sam-theme-auto .sam-en-alert h2, body.sam-theme-auto .sam-en-alert li a { color: #F7C870; }
	body.sam-theme-auto .sam-en-alert li { border-top-color: #4A3A18; }
	body.sam-theme-auto .sam-en-alert .sam-en-alert-note { color: #C9B27C; }
	body.sam-theme-auto .sam .sam-en-alert button.sam-en-alert-btn { background: #172029; color: #F7C870; border-color: #6B5320; }
	body.sam-theme-auto .sam-en-alert-done { background: #241D10; border-color: #4A3A18; border-left-color: #B7832A; color: #F3E3C0; }
	body.sam-theme-auto .sam-en-alert-done > summary { color: #F7C870; }
	body.sam-theme-auto .sam-en-alert-done > summary span, body.sam-theme-auto .sam-en-alert-done .sam-en-alert-note { color: #C9B27C; }
	body.sam-theme-auto .sam-en-alert-done li { border-top-color: #4A3A18; }
	body.sam-theme-auto .sam-pf-note, body.sam-theme-auto .sam-pf-pending { background: #1B2530; }
	body.sam-theme-auto .sam .sam-btn.sam-btn-ghost, body.sam-theme-auto .sam button.sam-btn.sam-btn-ghost, body.sam-theme-auto .sam a.sam-btn-ghost { background: #172029; color: #E7EBF1 !important; border-color: #384556; }
	body.sam-theme-auto .sam-table th { color: #C7CED9; }
	body.sam-theme-auto { --sam-tone-teal-soft: color-mix(in srgb, var(--sam-tone-teal-solid, #0B6E6E) 62%, #000000); --sam-tone-teal-ink: color-mix(in srgb, var(--sam-tone-teal-solid, #0B6E6E) 22%, #FFFFFF); --sam-tone-blue-soft: color-mix(in srgb, var(--sam-tone-blue-solid, #1D4ED8) 62%, #000000); --sam-tone-blue-ink: color-mix(in srgb, var(--sam-tone-blue-solid, #1D4ED8) 22%, #FFFFFF); --sam-tone-amber-soft: color-mix(in srgb, var(--sam-tone-amber-solid, #B45309) 62%, #000000); --sam-tone-amber-ink: color-mix(in srgb, var(--sam-tone-amber-solid, #B45309) 22%, #FFFFFF); --sam-tone-grey-soft: color-mix(in srgb, var(--sam-tone-grey-solid, #4A5464) 62%, #000000); --sam-tone-grey-ink: color-mix(in srgb, var(--sam-tone-grey-solid, #4A5464) 22%, #FFFFFF); --sam-tone-green-soft: color-mix(in srgb, var(--sam-tone-green-solid, #15803D) 62%, #000000); --sam-tone-green-ink: color-mix(in srgb, var(--sam-tone-green-solid, #15803D) 22%, #FFFFFF); --sam-tone-purple-soft: color-mix(in srgb, var(--sam-tone-purple-solid, #6D28D9) 62%, #000000); --sam-tone-purple-ink: color-mix(in srgb, var(--sam-tone-purple-solid, #6D28D9) 22%, #FFFFFF); --sam-tone-red-soft: color-mix(in srgb, var(--sam-tone-red-solid, #B91C1C) 62%, #000000); --sam-tone-red-ink: color-mix(in srgb, var(--sam-tone-red-solid, #B91C1C) 22%, #FFFFFF); }
	body.sam-theme-auto .sam-rate-chip.is-green, body.sam-theme-auto .sam-doc-type.is-excel, body.sam-theme-auto .sam-hs-chip.is-good, body.sam-theme-auto .sam-hs-a.is-yes, body.sam-theme-auto .sam-pr-state.is-done, body.sam-theme-auto .sam-ra-badge.is-good, body.sam-theme-auto .sam-sf-key.is-ok, body.sam-theme-auto .sam .sam-sf-cald.is-ok, body.sam-theme-auto .sam-cu-totals tr.is-good td, body.sam-theme-auto .sam-cu-totals tr.is-good th { background: #14532D; color: #BBF7D0; }
	body.sam-theme-auto .sam-rate-chip.is-red, body.sam-theme-auto .sam-doc-type.is-pdf, body.sam-theme-auto .sam-hs-chip.is-poor, body.sam-theme-auto .sam-hs-a.is-no, body.sam-theme-auto .sam-ptw-problems, body.sam-theme-auto .sam-pr-state.is-overdue, body.sam-theme-auto .sam-ra-badge.is-bad, body.sam-theme-auto .sam-sf-attn li.is-red, body.sam-theme-auto .sam-sf-key.is-miss, body.sam-theme-auto .sam .sam-sf-cald.is-miss, body.sam-theme-auto .sam-sf-allergen td.is-has, body.sam-theme-auto .sam-cashup tr.is-bad td, body.sam-theme-auto .sam-cashup tr.is-bad th { background: #7F1D1D; color: #FECACA; }
	body.sam-theme-auto .sam-rate-chip.is-amber, body.sam-theme-auto .sam-notice.is-warn, body.sam-theme-auto .sam-doc-type.is-powerpoint, body.sam-theme-auto .sam-hs-chip.is-fair, body.sam-theme-auto .sam-hs-a.is-blank, body.sam-theme-auto .sam-hsm-sum td.sam-hsm-c.is-due a, body.sam-theme-auto .sam-lad-badge.is-warn, body.sam-theme-auto .sam-ptw-risklist li, body.sam-theme-auto .sam-badge-in_progress, body.sam-theme-auto .sam-formb-tag, body.sam-theme-auto .sam-sf-attn li.is-amber, body.sam-theme-auto .sam-sf-key.is-warn, body.sam-theme-auto .sam .sam-sf-cald.is-warn, body.sam-theme-auto .sam-sf-allergen td.is-may { background: #78350F; color: #FDE68A; }
	body.sam-theme-auto .sam-doc-type.is-word, body.sam-theme-auto .sam-hsm-sum td.sam-hsm-c.is-planned a, body.sam-theme-auto .sam-ra-badge.is-review, body.sam-theme-auto .sam-ra-badge.is-draft, body.sam-theme-auto .sam-badge-new { background: #1E3A8A; color: #BFDBFE; }
	body.sam-theme-auto select option, body.sam-theme-auto select optgroup { background-color: #172029; color: #E7EBF1; }
	body.sam-theme-auto .sam-top .sam-switch select { background-color: #172029; color: #E7EBF1; border-color: #435064; }
	/* 1.100.18: the site's theme (BeTheme) makes a clicked drop-down pale blue with !important; keep it dark. */
	body.sam-theme-auto select:focus:not(.is-e):not(.is-i), body.sam-theme-auto textarea:focus, body.sam-theme-auto input:focus { background-color: var(--sam-surface, #172029) !important; color: var(--sam-ink, #E7EBF1) !important; }
	body.sam-theme-auto td.sam-hsm-c.is-now, body.sam-theme-auto .sam-ra-versions tr.is-here td { background: #16302F; }
	/* Matrix pop-up (1.101.1): a lighter panel, a clear edge and a darker page behind, or it blends into the dark page. */
	body.sam-theme-auto .sam-hsm-dialog { background: #243140; border-color: #6B7A90; border-top-color: var(--sam-accent); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75); }
	body.sam-theme-auto .sam-hsm-dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
	body.sam-theme-auto .sam-hsm-x:hover { background: rgba(255, 255, 255, 0.1); }
	body.sam-theme-auto .sam .sam-hsm-detail .sam-field input[type="file"] { padding-top: 6px; padding-bottom: 6px; }
	/* Matrix (1.100.24): before records started keeps the key's own colours with a faint hatch, like its key swatch; opacity left dark writing on murky colour. */
	body.sam-theme-auto td.sam-hsm-c.is-past a { opacity: 1; background-image: repeating-linear-gradient(135deg, rgba(15, 27, 45, 0.14) 0 3px, transparent 3px 6px); }
	body.sam-theme-auto td.sam-hsm-c.is-na a, body.sam-theme-auto .sam-hsm-k.is-na { background: #4B5563; color: #E7EBF1; }
	body.sam-theme-auto .sam-cap-table tfoot th, body.sam-theme-auto .sam-cap-table tfoot td, body.sam-theme-auto .sam-cap-row-total th, body.sam-theme-auto .sam-cap-row-total td, body.sam-theme-auto .sam .sam-cap-input:disabled { background: #26334A; color: #F2F5F9; }
	body.sam-theme-auto .sam-rates-next-note { color: #93C5FD; }
	body.sam-theme-auto img.sam-site-logo, body.sam-theme-auto .sam-en-logo { padding: 6px 10px; background: #FFFFFF; border-radius: 8px; box-sizing: content-box; }
	body.sam-theme-auto .sam input[type=file], body.sam-theme-auto .sam-pr-docform input[type=file] { border-color: #6B7A90; }
	body.sam-theme-auto .sam input[type=file]::file-selector-button { background: #2B3644; color: #E7EBF1; border: 1px solid #56657B; border-radius: 8px; padding: 6px 12px; }
	body.sam-theme-auto .sam-bms-raw pre { background: #1B2530; }
	body.sam-theme-auto .sam-bmsc-spin { border-color: #384556; border-top-color: var(--sam-accent, #16857F); }

}
/* 1.100.21: phones, menu open in dark mode – the light sidebar's header logo is dark artwork, so show the white sidebar logo (the one in the bar) instead. */
@media (max-width: 899px) {
	body.sam-theme-dark.sam-side-light.sam-menu-open .sam-side-head .sam-brand:not(.sam-brand-bar) { display: none; }
	body.sam-theme-dark.sam-side-light.sam-menu-open .sam-side-head .sam-brand-bar { display: flex; color: var(--sam-side-text, #E7EBF1); }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
	body.sam-theme-auto.sam-side-light.sam-menu-open .sam-side-head .sam-brand:not(.sam-brand-bar) { display: none; }
	body.sam-theme-auto.sam-side-light.sam-menu-open .sam-side-head .sam-brand-bar { display: flex; color: var(--sam-side-text, #E7EBF1); }
}
/* The page behind short pages too. */
html:has(body.sam-theme-dark) { background: #0E141C; }
@media (prefers-color-scheme: dark) { html:has(body.sam-theme-auto) { background: #0E141C; } }
@media print {
	body.sam-theme-dark, body.sam-theme-auto { color-scheme: light; }
}

/* 1.109.4: Capital Projects running budget in dark mode – the no-amount warning and highlighted lines were pale yellow boxes (the user's report). */
body.sam-theme-dark .sam-cap-missing-note { background: #3A2A0E; border-color: #B7791F; color: #FDE68A; }
body.sam-theme-dark .sam-cap-table tr.is-missing td { background: #2E2410; }
body.sam-theme-dark .sam-cap-missing, body.sam-theme-dark .sam-cap-varnote { color: #FDE68A; }
@media (prefers-color-scheme: dark) {
	body.sam-theme-auto .sam-cap-missing-note { background: #3A2A0E; border-color: #B7791F; color: #FDE68A; }
	body.sam-theme-auto .sam-cap-table tr.is-missing td { background: #2E2410; }
	body.sam-theme-auto .sam-cap-missing, body.sam-theme-auto .sam-cap-varnote { color: #FDE68A; }
}

/* 1.115 (the user's report): typing boxes in the theme's own font, not the browser's (some showed typewriter-style text). */
.sam textarea, .sam input, .sam select, .sam button { font-family: inherit !important; }
.sam textarea { font-size: 16px; line-height: 1.5; }

/* Page not found (1.117.1): SAM's own, with a way back. */
.sam-404 { max-width: 560px; margin: 64px auto; padding: 40px 36px; background: var(--sam-surface); border: 1px solid var(--sam-line); border-radius: 16px; box-shadow: 0 10px 30px rgba(15, 27, 45, .06); text-align: center; }
.sam-404-code { margin: 0 0 6px; font-size: 64px; font-weight: 700; line-height: 1; color: var(--sam-accent); letter-spacing: -.02em; }
.sam-404 h1 { margin: 0 0 12px; font-size: 26px; color: var(--sam-ink); }
.sam-404 p:not(.sam-404-code) { margin: 0 0 24px; color: var(--sam-muted); font-size: 16px; line-height: 1.55; }
.sam-404-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
@media (max-width: 600px) { .sam-404 { margin: 32px 16px; padding: 32px 20px; } .sam-404-btns .sam-btn { width: 100%; } }
.sam .sam-404-btns [hidden] { display: none !important; }
.sam .sam-404-btns button.sam-btn.sam-btn-ghost { background: var(--sam-surface) !important; border: 1px solid var(--sam-line-strong); color: var(--sam-ink) !important; }

/* Backups on SAM Settings (1.124.1). */
.sam-backup-box { margin: 22px 0 6px; padding: 16px 20px; border: 1px solid var(--sam-line, #E3E7ED); border-left: 5px solid #0A6B32; border-radius: 12px; background: var(--sam-surface, #FFFFFF); }
.sam-backup-box.is-warn { border-left-color: #E0A030; }
.sam-backup-box.is-bad { border-left-color: #B3261E; }
.sam .sam-backup-box h2 { margin: 0 0 8px; font-size: 17px; }
.sam-backup-box p { margin: 0 0 6px; line-height: 1.5; }
.sam-backup-box p:last-child { margin-bottom: 0; }
.sam-backup-box a { margin-left: 6px; font-weight: 600; }

/* 2.0.5 (the user's wish): Help as a round icon in the header bar, before the name. */
.sam-me a.sam-top-help, .sam-top .sam-me a.sam-top-help { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; color: var(--sam-side-text, #FFFFFF); background: rgba(255, 255, 255, 0.1); text-decoration: none; opacity: 1; flex: 0 0 auto; }
.sam-me a.sam-top-help:hover, .sam-me a.sam-top-help:focus-visible, .sam-me a.sam-top-help.is-on { background: rgba(255, 255, 255, 0.22); }
.sam-me a.sam-top-help:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }

/* 2.0.6 (the user's wish): Forms and Submissions as tabs at the top of both pages. */
.sam .sam-forms-tabs { margin: 0 0 22px; gap: 8px; border-bottom: 0; }
.sam .sam-forms-tabs a { margin: 0; padding: 9px 22px; border: 1px solid var(--sam-line, #E3E6EB); border-radius: 999px; background: var(--sam-surface, #FFFFFF); color: var(--sam-ink-2, #3C4655); font-size: 15px; font-weight: 600; }
.sam .sam-forms-tabs a:hover { border-color: var(--sam-accent, #0B6E6E); color: var(--sam-ink, #0F1B2D); }
.sam .sam-forms-tabs a.is-active { background: var(--sam-accent, #0B6E6E); border-color: var(--sam-accent, #0B6E6E); color: #FFFFFF; }

/*
 * 2.1.17 (the user's wish): phones keep the whole blue header in view. The logo row holds Help, who's signed in and a
 * Sign out icon beside the Menu button; the site row (site logo + site box) sticks just under it. Computers unchanged.
 */
.sam-side-me, .sam-top-sitelogo { display: none; }
@media (max-width: 899px) {
	.sam-side-head { gap: 8px; }
	.sam-side-head .sam-brand-bar { margin-right: auto; min-width: 0; }
	.sam-side-head .sam-brand-bar .sam-brand-logo { height: 32px; width: auto; max-width: 140px; }
	.sam-side-head .sam-brand-bar .sam-brand-name { white-space: nowrap; }
	body:not(.sam-menu-open) .sam-side-me { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; color: #FFFFFF; }
	.sam-side-me a { color: #FFFFFF; text-decoration: none; }
	.sam-side-me a.sam-top-help, .sam-side-me .sam-side-me-out { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); flex: 0 0 auto; }
	.sam-side-me a.sam-top-help:hover, .sam-side-me .sam-side-me-out:hover, .sam-side-me a.sam-top-help.is-on { background: rgba(255, 255, 255, 0.22); }
	.sam-side-me-who { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
	.sam-side-me .sam-avatar { width: 38px; height: 38px; background: rgba(255, 255, 255, 0.16); color: #FFFFFF; }
	.sam-side-me a:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
	/* The same things in the second row aren't needed on phones. */
	.sam-top .sam-me { display: none; }
	/* The site logo moves beside the site box; the sidebar keeps it only while the menu is open. */
	body:not(.sam-menu-open) .sam-side-site { display: none; }
	.sam-top-sitelogo { display: inline-flex; flex: 0 0 auto; }
	.sam-top-sitelogo .sam-side-site-logo { max-height: 40px; max-width: 120px; padding: 4px 8px; }
	.sam-top .sam-switch label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.sam-top .sam-top-site { gap: 10px; }
	/* The site row stays under the logo bar while the page scrolls. */
	.sam-top { position: sticky; top: var(--sam-side-h, 64px); z-index: 49; padding-top: 0; padding-bottom: 12px; }
	body.sam-menu-open .sam-top { position: static; }
}
@media (max-width: 520px) { .sam-side-me-name { display: none; } } /* Small phones: the initials stand for the name. */
@media (max-width: 440px) {
	.sam-menu-btn .sam-menu-word { display: none; }
	body:not(.sam-menu-open) .sam-menu-btn { padding: 0 11px; }
}
/* 2.1.23: Edit readings – Delete every reading before a date. */
.sam-rd-before { margin: 20px 0 8px; padding: 14px 18px; border: 1px solid var(--sam-line, #E3E6EB); border-radius: 12px; background: var(--sam-surface, #FFFFFF); }
.sam-rd-before > summary { cursor: pointer; font-weight: 600; }
.sam-rd-before[open] > summary { margin-bottom: 10px; }
.sam-rd-before form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 10px; }
.sam-rd-before label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }

/* 2.1.25: loading (assets/loading.js, SAM_App::loading_start()) – since 2.1.29 the page greys out with only the app's logo turning in the middle (the user's wish). */
.sam-loading { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; background: rgba(17, 24, 39, .45); opacity: 0; pointer-events: none; }
.sam-loading.is-on { animation: sam-loading-in .12s ease-out forwards; } /* 2.1.26: in CSS, so it works when the page's scripts are paused; no wait since 2.1.28. */
.sam-loading[hidden] { display: none; }
.sam-loading-logo { display: block; width: 88px; height: 88px; border-radius: 22%; box-shadow: 0 14px 36px rgba(0, 0, 0, .35); animation: sam-loading-turn 1.4s cubic-bezier(.45, 0, .25, 1) infinite; }
@keyframes sam-loading-turn { 0% { transform: perspective(400px) rotateY(0); } 70%, 100% { transform: perspective(400px) rotateY(360deg); } }
@keyframes sam-loading-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sam-loading-logo { animation: sam-loading-pulse 1.4s ease-in-out infinite; } @keyframes sam-loading-pulse { 50% { opacity: .45; } } }
@media print { .sam-loading { display: none !important; } }

/* 2.2.6: project timeline (Gantt) in dark mode – weekend shading, labels, bars */
body.sam-theme-dark { --sam-gt-shade: #1F2935; }
body.sam-theme-dark .sam-gt-row .sam-gt-label { box-shadow: 0 1px 0 var(--sam-line-soft); }
body.sam-theme-dark .sam-gt-pct { color: #FFFFFF; text-shadow: 0 0 3px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.75); }
body.sam-theme-dark .sam-gt-bar.is-overdue, body.sam-theme-dark .sam-gt-key.is-overdue { background: #3B1A1A; }
body.sam-theme-dark .sam-gt-bar.is-done, body.sam-theme-dark .sam-gt-bar.is-done .sam-gt-fill, body.sam-theme-dark .sam-gt-key.is-done, body.sam-theme-dark .sam-gt-ms.is-done { background: #5E7A69; }
body.sam-theme-dark .sam-gt-sum, body.sam-theme-dark .sam-gt-key.is-sum { background: #4A5668; }
body.sam-theme-dark .sam-gt-target:not(.is-late), body.sam-theme-dark .sam-gt-key.is-target { border-left-color: #E0A030; }
@media (prefers-color-scheme: dark) {
	body.sam-theme-auto { --sam-gt-shade: #1F2935; }
	body.sam-theme-auto .sam-gt-row .sam-gt-label { box-shadow: 0 1px 0 var(--sam-line-soft); }
	body.sam-theme-auto .sam-gt-pct { color: #FFFFFF; text-shadow: 0 0 3px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.75); }
	body.sam-theme-auto .sam-gt-bar.is-overdue, body.sam-theme-auto .sam-gt-key.is-overdue { background: #3B1A1A; }
	body.sam-theme-auto .sam-gt-bar.is-done, body.sam-theme-auto .sam-gt-bar.is-done .sam-gt-fill, body.sam-theme-auto .sam-gt-key.is-done, body.sam-theme-auto .sam-gt-ms.is-done { background: #5E7A69; }
	body.sam-theme-auto .sam-gt-sum, body.sam-theme-auto .sam-gt-key.is-sum { background: #4A5668; }
	body.sam-theme-auto .sam-gt-target:not(.is-late), body.sam-theme-auto .sam-gt-key.is-target { border-left-color: #E0A030; }
}
