/* Design "B · Datu karte": colour and size tokens. Dark follows the OS setting. */
:root {
	--bg: #f7f8fa;
	--surface: #ffffff;
	--ink: #101828;
	--muted: #475467;
	--accent: #0b5fa5;
	--accent-ink: #ffffff;
	--hot: #c2410c;
	--line: #e4e7ec;
	--field: #858fa1;
	--tint: #eef4fb;
	--ok: #067647;
	--ok-bg: #ecfdf3;
	--err: #b42318;
	--err-bg: #fef3f2;
	--ctl: 44px;
	--r: 8px;
	--max: 1240px;
	--sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

	/* data layers (lake page) */
	--l-lake: #3f74d6;
	--l-land: #a39b00;
	--l-island: #a39b00;
	--l-floor: #9a6a1f;
	--l-lakeshore: #d4a800;
	--l-surroundings: #e39a2e;
	--l-catchment: #7a9fe0;
	--l-objects: #e8562a;
	--l-creation: #8a6fd1;
	--l-recreation: #e0820b;
	--l-chemistry: #1f8ee8;
	--l-macrophyte: #2fa84f;
	--l-fish: #2a9d9d;
	--l-mammals: #4bb3b3;
	--l-birds: #339999;
	--l-phytoplankton: #5cc45c;
	--l-zooplankton: #93c43a;
	--l-invertebrates: #b8860b;
	--l-dangers: #c0392b;
	--l-habitats: #1f8f3a;
	--l-other: #858fa1;

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0b1220;
		--surface: #111a2b;
		--ink: #e6ebf2;
		--muted: #9aa8bb;
		--accent: #6cb2f0;
		--accent-ink: #0b1220;
		--hot: #fb923c;
		--line: #233046;
		--field: #5b6b85;
		--tint: #16233a;
		--ok: #6ce9a6;
		--ok-bg: #0c2a1d;
		--err: #fda29b;
		--err-bg: #3a1512;
		color-scheme: dark;
	}
}

@media (max-width: 640px) {
	:root { --ctl: 48px; }
}

/* Design B: page frame (top bar, tabs, main, footer) */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.5;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--hot); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); border-radius: var(--r); }
.skip:focus { top: 8px; color: var(--accent-ink); }

/* top bar */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--max); margin: 0 auto; padding: 8px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.brand { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-name { font-family: var(--mono); font-size: 19px; font-weight: 600; }
.top-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seg { display: flex; gap: 4px; }
.seg .btn { min-width: 44px; height: 44px; padding: 0 10px; font-family: var(--mono); font-size: 14px; }
.design-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.user-name { font-weight: 600; font-size: 15px; }

.tabs-bar { border-top: 1px solid var(--line); }
.tabs-in { max-width: var(--max); margin: 0 auto; padding: 0 24px 0 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; }
.tabs { display: flex; overflow-x: auto; }
.tab { display: flex; align-items: center; justify-content: center; height: 48px; padding: 0 16px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs-search { flex: 0 1 340px; min-width: 0; margin: 6px 0 6px 16px; }

/* main */
.main { width: 100%; max-width: var(--max); margin: 0 auto; padding: 20px 24px 0; display: flex; flex-direction: column; gap: 20px; }

/* footer */
.ft { margin-top: auto; padding-top: 32px; }
.ft-in { max-width: var(--max); margin: 0 auto; padding: 8px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; font-size: 14px; }
.ft-bar { border-top: 1px solid var(--line); background: var(--surface); }
.ft a { display: inline-flex; align-items: center; min-height: 44px; }
.ft-note { margin-left: auto; color: var(--muted); }

@media (max-width: 640px) {
	.top-in { padding: 6px 8px 6px 16px; }
	.brand-name { font-size: 18px; }
	.tabs-in { padding: 0; }
	.tabs { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.tab { padding: 0 8px; }
	.tabs-search { flex: 1 1 100%; margin: 0 16px 10px; }
	.main { padding: 16px 16px 0; gap: 16px; }
	.ft-in { padding: 10px 16px 20px; gap: 0 18px; }
	.ft-note { margin-left: 0; }
	h1 { font-size: 26px; }
}

/* Design B: reusable components */

/* buttons */
.btn {
	-webkit-appearance: none; appearance: none;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
	height: var(--ctl); min-width: var(--ctl); margin: 0; padding: 0 16px;
	border: 1px solid transparent; border-radius: var(--r);
	font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
	white-space: nowrap; text-decoration: none; cursor: pointer;
}
.btn-p, a.btn-p:hover { background: var(--accent); color: var(--accent-ink); }
.btn-p:hover { filter: brightness(1.08); }
.btn-s { background: var(--surface); color: var(--ink); border-color: var(--field); }
.btn-s:hover, a.btn-s:hover { border-color: var(--accent); color: var(--ink); }
.btn-w { display: flex; width: 100%; }
.btn-sm { height: 36px; min-width: 36px; padding: 0 12px; font-size: 14px; }
.btn[aria-current="true"], .btn[aria-current="page"] { background: var(--tint); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn svg, .more svg, .ib svg { flex: none; }
.ib { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: var(--r); color: var(--ink); }

/* form fields */
.lbl { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fld {
	-webkit-appearance: none; appearance: none;
	display: block; width: 100%; min-width: 0; height: var(--ctl); margin: 0; padding: 0 12px;
	border: 1px solid var(--field); border-radius: var(--r);
	background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
.fld:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
textarea.fld { height: auto; min-height: 128px; padding: 12px; line-height: 1.5; resize: vertical; }
input[type="file"].fld { height: auto; padding: 10px 12px; }
.fld::placeholder { color: var(--muted); opacity: 1; }
.sel { position: relative; display: block; min-width: 0; }
.sel .fld { padding-right: 38px; text-overflow: ellipsis; }
.sel::after {
	content: ""; position: absolute; right: 15px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
	border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none;
}
.grp { display: flex; height: var(--ctl); min-width: 0; border: 1px solid var(--field); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.grp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.grp input { -webkit-appearance: none; appearance: none; flex: 1 1 auto; width: 0; min-width: 0; height: 100%; margin: 0; padding: 0 12px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
.grp input::placeholder { color: var(--muted); opacity: 1; }
.grp .btn { height: 100%; border: 0; border-radius: 0; }
.grp .btn-s { border-left: 1px solid var(--line); }
input::-webkit-search-decoration, input::-webkit-search-cancel-button { -webkit-appearance: none; }
.chk { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding-top: 10px; font-size: 15px; }
.chk input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

/* vertical forms */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.form-wide { max-width: none; }
.field { display: flex; flex-direction: column; min-width: 0; }
.help { margin-top: 6px; font-size: 13px; color: var(--muted); }
.field-err .fld { border-color: var(--err); }
.err-msg { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--err); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }

/* cards and lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 16px; border-bottom: 1px solid var(--line); min-height: 48px; }
.card-head h2 { font-size: 16px; }
.more { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.rl { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px; color: var(--ink); text-decoration: none; }
.rl:hover { background: var(--tint); color: var(--ink); }
.rl-t { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; }
.rl-m { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.rl-b { display: block; padding: 12px 16px; }
.rl-b .rl-m, .rl-b .rl-t { display: block; }
.rl-b .rl-t { margin-top: 3px; }

/* page heading */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 0 0 4px; padding: 0; list-style: none; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 500; text-decoration: none; }
.crumbs [aria-current] { color: var(--ink); }
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.ph-t { min-width: 0; }
.ph-sub { margin-top: 6px; font-size: 15px; line-height: 1.4; color: var(--muted); }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* notices */
.note { padding: 12px 16px; border-radius: var(--r); background: var(--tint); font-size: 15px; line-height: 1.5; }
.note p + p { margin-top: 8px; }
.note h2 { margin-bottom: 6px; font-size: 16px; }
.note-ok { background: var(--ok-bg); color: var(--ok); }
.note-err { background: var(--err-bg); color: var(--err); }
.note .trace { margin-top: 8px; font-family: var(--mono); font-size: 13px; }

/* tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { padding: 10px 12px; text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
.tbl tbody tr:hover { background: var(--tint); }
.tbl .r { text-align: right; }
.tbl .n { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.tbl .t { font-weight: 600; color: var(--ink); text-decoration: none; }
.tbl a.t:hover { color: var(--accent); }
.tbl .sub { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); font-weight: 400; }
.empty { padding: 16px; color: var(--muted); }

/* pager */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: var(--mono); font-size: 14px; }
.pager .btn { padding: 0 10px; font-family: var(--mono); }
.pager .btn.txt { font-family: var(--sans); }
.pager .gap { padding: 0 4px; color: var(--muted); }
.pager .off { opacity: 0.45; pointer-events: none; }
.pager-info { margin-left: auto; color: var(--muted); }

/* stats */
.stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats > div { padding: 10px 12px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-family: var(--mono); font-size: 18px; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }

/* horizontal bars (lakes per district) */
.bar { display: grid; grid-template-columns: 104px minmax(0, 1fr) 44px; align-items: center; gap: 10px; min-height: 36px; color: var(--ink); text-decoration: none; font-size: 14px; }
.bar:hover { color: var(--accent); }
.bar i { display: block; height: 8px; border-radius: 2px; background: var(--accent); }
.bar b { text-align: right; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--muted); }
.bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* comments and posts */
.posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.post { padding: 12px 16px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; margin-bottom: 4px; }
.post-author { font-size: 15px; font-weight: 700; }
.post-date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.post-body { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.post-first { border-color: var(--accent); }

/* article text */
.prose { font-size: 17px; line-height: 1.65; overflow-wrap: break-word; }
.prose > * + * { margin-top: 14px; }
.prose h1, .prose h2, .prose h3 { margin-top: 24px; font-size: 20px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 6px; }
.prose img { border-radius: 6px; }
.prose table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; font-size: 15px; }
.prose td, .prose th { padding: 6px 10px; border: 1px solid var(--line); }
.prose blockquote { margin-left: 0; padding-left: 16px; border-left: 3px solid var(--line); color: var(--muted); }
.lead { padding: 12px 14px; background: var(--tint); border-radius: var(--r); font-size: 17px; line-height: 1.5; }

/* two-column layouts that stack on narrow screens */
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.split-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cols3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; align-items: start; }

/* side navigation (categories, reports) */
.side-nav { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.side-nav h2 { padding: 8px 12px 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.cat { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 15px; }
.cat:hover { background: var(--tint); color: var(--ink); }
.cat span { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.cat[aria-current] { background: var(--tint); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }

@media (max-width: 640px) {
	.tbl { font-size: 14px; }
	.btn { font-size: 16px; }
	.pager-info { margin-left: 0; flex-basis: 100%; }
	.stats dd { font-size: 17px; }
}

/* field_status() output under a field: <span id="xStatus" class="error|success"><span>message</span></span> */
.field > span[id$="Status"] { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.field > span[id$="Status"]:not(.error):not(.success) { display: none; }
.field > span[id$="Status"].error { color: var(--err); font-weight: 600; }
.field > span[id$="Status"].success { color: var(--ok); }
.field-err .fld, .field:has(> span.error) .fld { border-color: var(--err); }

/* Design B: page-specific layout */
.list-plain { list-style: none; margin: 0; padding: 0; }

/* home */
.home-top { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.home-map-card { flex: 999 1 560px; min-width: 0; margin: 0; padding: 18px; display: flex; flex-direction: column; }
.home-map-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 12px; }
.home-map-head h1 { font-size: 28px; }
.home-map-head .muted { font-size: 14px; }
.home-map { flex: 1; min-height: 460px; border-radius: 6px; overflow: hidden; }
.home-map-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 12px; font-size: 14px; }
.dot-hot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 999px; background: var(--hot); vertical-align: -1px; }
.map-label { padding: 1px 5px; border: 0; border-radius: 3px; background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.map-label::before { display: none; }
.home-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.home-search { display: flex; flex-direction: column; gap: 10px; }
.home-filters { justify-content: space-between; }
.home-filters > span { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.home-districts { flex: 1; padding: 6px 16px 12px; }
.home-districts-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.home-districts-head h2 { font-size: 16px; }
.home-districts-more summary { cursor: pointer; list-style: none; color: var(--accent); }
.home-districts-more summary::-webkit-details-marker { display: none; }
.home-districts-more[open] summary { display: none; }

@media (max-width: 640px) {
	.home-map-card { padding: 12px; }
	.home-map-head h1 { font-size: 24px; }
	.home-map { min-height: 300px; }
	.home-side { order: -1; }
}

/* lake page */
.lake-head .ph-sub .num { white-space: nowrap; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
.facts > div { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.facts > div:nth-child(odd) { border-right: 1px solid var(--line); }
.facts dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-family: var(--mono); font-size: 18px; font-weight: 600; }
.facts dd.hot { color: var(--hot); }
.facts-empty { padding: 12px 14px; color: var(--muted); }
.layers-card { padding: 12px; }
.layers-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.layers-card-head h2 { font-size: 15px; }
.strip { display: flex; height: 12px; border-radius: 3px; overflow: hidden; gap: 1px; margin-bottom: 8px; }
.lg { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; }
.lg:hover { background: var(--tint); color: var(--ink); }
.lg i { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.lg b { margin-left: auto; font-family: var(--mono); font-weight: 600; font-size: 13px; color: var(--muted); }
.lg[aria-current] { background: var(--tint); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
#toggleAllLayers { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; margin-top: 8px; border: 1px solid var(--field); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
#toggleAllLayers:hover { border-color: var(--accent); }

.layer { border-top: 4px solid var(--layer, var(--l-other)); overflow: hidden; scroll-margin-top: 12px; }
.layer-h { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; margin: 0; padding: 8px 16px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; text-align: left; cursor: pointer; }
.layer-h:hover { background: var(--tint); }
.layer-h .sw { flex: none; width: 12px; height: 12px; border-radius: 3px; background: var(--layer, var(--l-other)); }
.layer-h .num { font-size: 13px; font-weight: 500; color: var(--muted); }
.layer-h::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s; }
.layerCollapsed.layer-h::after { transform: rotate(-45deg); }
.dt { width: 100%; border-collapse: collapse; font-size: 14px; }
.dt th { padding: 8px; text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.dt td { padding: 8px; border-top: 1px solid var(--line); vertical-align: top; }
.dt th:first-child, .dt td:first-child { padding-left: 16px; }
.dt th:last-child, .dt td:last-child { padding-right: 16px; }
.dt .v { text-align: right; font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.dt .v-text { text-align: left; font-family: var(--sans); white-space: normal; }
.dt .m { color: var(--muted); }
.dt .d { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.dt .cont td { border-top: 0; padding-top: 0; }
.dt .opt { display: block; font-size: 13px; color: var(--muted); }
.dt .del { display: inline-flex; vertical-align: middle; margin-left: 6px; }
.dt .del img { width: 16px; height: 16px; }
.dt .edit { color: var(--ink); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 12px 16px 16px; }
.photo { margin: 0; font-size: 13px; color: var(--muted); }
.photo a { display: block; }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.photo figcaption { margin-top: 4px; overflow-wrap: anywhere; }
.lake-map { height: 320px; border-radius: var(--r); overflow: hidden; }
.lake-desc { font-size: 16px; line-height: 1.6; }

/* data entry (admins) on the lake page */
#add-data-container .form { max-width: 640px; }
#add-data-form .chk { padding-top: 0; }

/* advanced search */
.as-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.as-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.as-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.as-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.as-help { font-size: 14px; font-weight: 600; }
#param-form .form { max-width: none; }
.num-rule { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }

/* journal and forums */
.j-cat { color: var(--hot); font-size: 14px; text-transform: lowercase; }
.lc { text-transform: lowercase; }
.article { max-width: 760px; }
.article-meta { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.article-meta div { display: flex; gap: 6px; }
.article-meta dd { margin: 0; color: var(--ink); }
.article-meta .cat-v { color: var(--hot); font-weight: 600; text-transform: lowercase; }
.attachments { margin-top: 24px; }
.comments-block { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.preview { padding: 12px 16px; border: 1px dashed var(--field); border-radius: var(--r); background: var(--surface); }

/* auth pages */
.auth { max-width: 520px; display: flex; flex-direction: column; gap: 16px; }
#lake-list-table td:first-child { font-family: var(--mono); font-size: 13px; color: var(--muted); }
#lake-list-table td:last-child { font-family: var(--mono); font-size: 13px; color: var(--muted); }
#lake-list-table td a { font-weight: 600; color: var(--ink); text-decoration: none; }
#lake-list-table td a:hover { color: var(--accent); }
#lake-list-table td span { display: block; font-size: 14px; color: var(--muted); }
#lake-list:not(.hidden) ~ .as-empty-hint { display: none; }
.as-tools #addParamLink { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.as-help { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 640px) {
	.j-col-cat { display: none; }
}

/* forum topic rows */
.tp-head, .tp { display: grid; grid-template-columns: minmax(0, 1fr) 64px 132px; gap: 12px; align-items: center; padding: 10px 16px; }
.tp-head { font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.tp-head span:not(:first-child), .tp .n, .tp .d { text-align: right; }
.tp { min-height: 56px; color: var(--ink); text-decoration: none; }
.tp:hover { background: var(--tint); color: var(--ink); }
.tp .t { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.tp .s { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.tp .n, .tp .d { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.forum-search { max-width: 520px; }
@media (max-width: 640px) {
	.tp-head, .tp { grid-template-columns: minmax(0, 1fr) 44px 72px; gap: 8px; padding: 10px 12px; }
}

/* Design B: class names produced by legacy JS widgets and by classic templates
   that have no design-B override (they fall back to tmpl/screens). */

/* classic page heading pieces */
.breadcrumbs ul { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.breadcrumbs a { text-decoration: none; }
.heading-decoration { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.heading-links { font-size: 14px; font-weight: 600; }
.alert, .status-messages, .actionStatus, .actionError, .lakeDescription, .lakeHiddenRecords { padding: 12px 16px; border-radius: var(--r); background: var(--tint); line-height: 1.5; }
.alert p + p, .status-messages p + p { margin-top: 8px; }
.alert h2 { margin-bottom: 6px; font-size: 16px; }
.actionError { background: var(--err-bg); color: var(--err); }
.actionStatus { background: var(--ok-bg); color: var(--ok); }
.clearfix::after { content: ""; display: table; clear: both; }
.clearer { clear: both; height: 0; overflow: hidden; }

/* classic results lists and tables */
ul.results, .references-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
ul.results > li, .references-list > li { padding: 12px 16px; }
ul.results > li + li, .references-list > li + li { border-top: 1px solid var(--line); }
ul.results h2, .references-list h2 { font-size: 16px; }
ul.results p, .references-list p { margin-top: 4px; color: var(--muted); font-size: 15px; }
.references-list .item-id { float: left; width: 32px; font-family: var(--mono); color: var(--muted); }
.references-list .item-data { margin-left: 32px; }
div.results > table, .results table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: 15px; }
.results th { padding: 10px 12px; text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.results td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.results tr.alternate td { background: transparent; }
.item-count-container { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.norecords, .list-empty { padding: 16px; color: var(--muted); }
#about h2 { margin: 20px 0 6px; }
#about .logo-small { float: right; max-width: 120px; margin: 0 0 12px 16px; }
#about p { line-height: 1.6; }

/* advanced search: rows built by AdvancedSearchManager */
.delete-row { width: 1%; text-align: center; }
a.delete-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--field); border-radius: var(--r); color: var(--ink); font-family: var(--mono); font-weight: 600; text-decoration: none; }
a.delete-link:hover { border-color: var(--err); color: var(--err); }
.addLink > a, .addLinkHideForm > a { display: inline-flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 16px; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.addLinkHideForm > a { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--field); }
.addLinkInProgress > a { display: inline-flex; align-items: center; height: var(--ctl); padding: 0 16px 0 40px; border-radius: var(--r); background: var(--tint) url(/resources/img/all/icons/in_progress.gif) no-repeat 14px center; color: var(--muted); font-weight: 600; text-decoration: none; pointer-events: none; }
.addLinkInProgress .help, .addLinkHideForm .help { display: none; }

/* status toast used by advanced search and data entry */
#statusBox { position: fixed; left: 50%; bottom: 20px; z-index: 50; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--r); background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 600; visibility: hidden; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2); }

/* pager built by Pager.js */
.table-helper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; }
.table-helper > br { display: none; }
.table-helper-statistics { order: 2; margin-left: auto; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.table-helper-navigation { display: flex; flex-wrap: wrap; gap: 6px; }
.table-helper-navigation a, .table-helper-navigation span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--field); border-radius: var(--r); background: var(--surface); color: var(--ink); font-family: var(--mono); font-size: 14px; font-weight: 600; text-decoration: none; }
.table-helper-navigation a:hover { border-color: var(--accent); color: var(--ink); }
.table-helper-navigation a.active { background: var(--tint); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.table-helper-navigation span.disabled { opacity: 0.45; }
.table-helper-navigation span.separator { border: 0; background: none; min-width: 0; }

/* classic forms (screens without a design-B override) */
.horizontalForm fieldset, .verticalForm fieldset { margin: 0; padding: 0; border: 0; }
.horizontalForm label, .verticalForm label { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.horizontalForm .textbox, .horizontalForm textarea, .horizontalForm select, .verticalForm .textbox, .verticalForm textarea {
	display: block; width: 100%; max-width: 520px; min-height: var(--ctl); padding: 8px 12px; border: 1px solid var(--field); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
.horizontalForm br { display: none; }
.field-error .textbox, .field-error textarea { border-color: var(--err); }
.error-message, p.error { color: var(--err); font-weight: 600; }
.explain { font-size: 13px; color: var(--muted); }

/* leaflet controls follow the theme */
.leaflet-container { font-family: var(--sans); background: var(--tint); }
.leaflet-container a { color: var(--accent); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-control-attribution { background: rgba(255, 255, 255, 0.8) !important; color: #475467; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
@media (prefers-color-scheme: dark) {
	.leaflet-tile-pane { filter: brightness(0.75) invert(1) contrast(0.9) hue-rotate(200deg) saturate(0.4); }
	.leaflet-control-attribution { background: rgba(17, 26, 43, 0.85) !important; color: #9aa8bb; }
}

/* lightbox */
#overlay { background-color: #000; }
#outerImageContainer, #imageDataContainer { background-color: var(--surface) !important; }
#imageData { color: var(--ink); font-family: var(--sans); }

#lightbox{
	position: absolute;
	left: 0;
	width: 100%;
	z-index: 100;
	text-align: center;
	line-height: 0;
	}

#lightbox a img{ border: none; }

#outerImageContainer{
	position: relative;
	background-color: #fff;
	width: 250px;
	height: 250px;
	margin: 0 auto;
	}

#imageContainer{
	padding: 10px;
	}

#loading{
	position: absolute;
	top: 40%;
	left: 0%;
	height: 25%;
	width: 100%;
	text-align: center;
	line-height: 0;
	}
#hoverNav{
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 100%;
	z-index: 10;
	}
#imageContainer>#hoverNav{ left: 0;}
#hoverNav a{ outline: none;}

#prevLink, #nextLink{
	width: 49%;
	height: 100%;
	background: transparent url(/resources/img/lightbox/blank.gif) no-repeat; /* Trick IE into showing hover */
	display: block;
	}
#prevLink { left: 0; float: left;}
#nextLink { right: 0; float: right;}
#prevLink:hover, #prevLink:visited:hover { background: url(/resources/img/lightbox/prevlabel.gif) left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url(/resources/img/lightbox/nextlabel.gif) right 15% no-repeat; }


#imageDataContainer{
	font: 10px Verdana, Helvetica, sans-serif;
	background-color: #fff;
	margin: 0 auto;
	line-height: 1.4em;
	overflow: auto;
	width: 100%	
	}

#imageData{	padding:0 10px; color: #666; }
#imageData #imageDetails{ width: 70%; float: left; text-align: left; }	
#imageData #caption{ font-weight: bold;	}
#imageData #numberDisplay{ display: block; clear: left; padding-bottom: 1.0em;	}			
#imageData #bottomNavClose{ width: 66px; float: right;  padding-bottom: 0.7em;	}	
		
#overlay{
	position: absolute;
	top: 0;
	left: 0;
	z-index: 90;
	width: 100%;
	height: 500px;
	background-color: #000;
	}