/**
 * StraboSearch v1 (§6) — page-local styles layered over /massets/css/main.css.
 * Everything namespaced ss- ; site components (buttons, grid, searchCountResult,
 * grayOut, loader) are reused untouched per §6.1.1.
 *
 * 2026-08 (Globe View M1): full-viewport app frame — criteria rail left,
 * results pane right, panes scroll internally on desktop
 * (GlobeView_Design_Proposal.md §3). The builder rows use the narrow
 * column layout at EVERY width now, since the rail is narrow on desktop too.
 *
 * 2026-08-24 (Globe View M4): below 1024px the frame stays full-viewport
 * too; the rail becomes an off-canvas criteria drawer (Filters pill,
 * backdrop), list content scrolls internally, and globe view goes
 * full-bleed with a pinned List | Globe toggle + result-count pill. See
 * the "mobile drawer" block at the end of the file.
 */

/* ---- app frame (Globe View M1) ------------------------------------------ */

/* Native widget chrome (select popups, scrollbars) must follow the dark
   theme. Without this, Chrome themes each select's popup from a heuristic
   over composited ancestor backgrounds, and a semi-transparent rail read
   as LIGHT (grey popup, black text) while the sort select over the opaque
   body read dark. */
:root {
	color-scheme: dark;
}

.ss-app-frame {
	display: flex;
	flex-direction: column;   /* stacked fallback; row on desktop below */
}

.ss-rail {
	/* Opaque blend of rgba(39,40,51,0.45) over the #1c1d26 body — same
	   look, but opaque so popup-theme heuristics can't misread it. */
	background: #212230;
	display: flex;
	flex-direction: column;
	min-height: 0;
	font-size: 0.8em;
}

/* One control size page-wide (Claire 2026-09-14): the rail already runs
   at 0.8em, and the theme's .button.small scaled its buttons down AGAIN
   (0.64 of base) while the results toolbar (tabs 0.9, List|Globe 0.85)
   sat unscaled. Every interactive control now lands at 0.8em of base:
   rail buttons + dropdowns + inputs here, tabs / sort / view toggle /
   Layers / mobile pills below. Card text and hints are content and keep
   their own sizes. */
.ss-rail .button,
.ss-rail .button.small,
.ss-rail input,
.ss-rail select,
.ss-sort select {
	font-size: 1em;   /* the theme sizes input/select in pt (13pt): rejoin the scale */
}

.ss-rail-head {
	padding: 1em 1.4em 0.2em;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

/* M4 mobile chrome: absent on desktop, enabled in the mobile block below. */
.ss-drawer-backdrop,
.ss-rail-close,
.ss-drawer-close-link,
.ss-filters-pill,
.ss-view-toggle.ss-globe-toggle,   /* outranks .ss-view-toggle's display */
.ss-count-pill {
	display: none;
}

.ss-rail-head h2 {
	font-size: 1.5em;
	margin: 0 0 0.4em 0;
}

.ss-rail-scroll {
	min-height: 0;
	padding: 0 1.4em;
}

.ss-rail-actions {
	padding: 1em 1.4em 1.2em;
	border-top: 1px solid rgba(144, 144, 144, 0.35);
}

.ss-actions-row {
	display: flex;
	gap: 0.6em;
	margin-top: 0.7em;
}

.ss-actions-row .button {
	flex: 1 1 0;
	width: auto;
	padding: 0 0.5em;
}

.ss-pane {
	min-width: 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.ss-results {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
	padding: 0 1.2em;
}

.ss-results .ss-tabbar {
	flex: 0 0 auto;
	padding-top: 0.9em;
}

.ss-results .ss-tab-content {
	flex: 1 1 auto;
	min-height: 0;
	padding-bottom: 1.2em;
}

/* Pre-search prompt centers in the empty pane (flex margin auto). */
.ss-results > .ss-quiet-prompt {
	margin: auto;
}

/* Desktop app frame: the page never scrolls, the panes do. */
@media screen and (min-width: 1024px) {
	body {
		overflow: hidden;
	}

	.ss-app-frame {
		flex-direction: row;
		height: calc(100vh - 3.5em);   /* below the fixed #header */
	}

	.ss-rail {
		flex: 0 0 340px;
		border-right: 1px solid rgba(144, 144, 144, 0.35);
	}

	.ss-rail-scroll {
		flex: 1 1 auto;
		overflow-y: auto;
	}

	.ss-results .ss-tab-content {
		overflow-y: auto;
	}
}

/* ---- criteria builder (§6.3) ------------------------------------------- */

.ss-criteria {
	margin-bottom: 1.5em;
}

.ss-row {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.55em;
	padding: 0.7em 0;
	border-top: 1px dotted rgba(144, 144, 144, 0.35);
}

.ss-row:first-child {
	border-top: 0;
}

.ss-row .ss-crit-select {
	flex: 0 0 auto;
	max-width: 100%;
}

.ss-row .ss-value {
	flex: 0 0 auto;
	min-width: 0;
}

.ss-row .ss-row-controls {
	flex: 0 0 auto;
	display: flex;
	gap: 0.4em;
	justify-content: flex-end;
}

.ss-value .ss-range-pair {
	display: flex;
	gap: 0.5em;
	align-items: center;
}

.ss-value .ss-range-pair input {
	max-width: 8em;
}

.ss-value .ss-hint {
	display: block;
	font-size: 0.75em;
	opacity: 0.7;
	margin-top: 0.3em;
}

.ss-value .ss-tristate label {
	margin-right: 1.2em;
}

/* NOT toggle + remove chips */
.ss-chipbtn {
	display: inline-block;
	padding: 0.15em 0.7em;
	border: 1px solid rgba(144, 144, 144, 0.6);
	border-radius: 999px;
	font-size: 0.8em;
	cursor: pointer;
	user-select: none;
	line-height: 1.8;
}

.ss-chipbtn.ss-on {
	background: #d9534f;
	border-color: #d9534f;
	color: #fff;
}

.ss-chipbtn:hover {
	border-color: #888;
}

/* vocab multi-select chips (§6.3.3) */
.ss-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em;
	margin-top: 0.35em;
}

.ss-chip {
	display: inline-block;
	padding: 0.1em 0.6em;
	background: rgba(144, 144, 144, 0.18);
	border-radius: 999px;
	font-size: 0.8em;
	line-height: 1.9;
	white-space: nowrap;
}

.ss-chip a {
	border-bottom: 0;
	margin-left: 0.35em;
	cursor: pointer;
}

/* typeahead dropdown */
.ss-typeahead {
	position: relative;
}

.ss-ta-list {
	position: absolute;
	z-index: 900;
	left: 0;
	right: 0;
	top: 100%;
	max-height: 16em;
	overflow-y: auto;
	background: #1c1d26;   /* site dark ground (main.css select option) */
	color: rgba(255, 255, 255, 0.75);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ss-ta-list,
.ss-modal-card,
.ss-rail-scroll,
.ss-tab-content {
	scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.ss-ta-list::-webkit-scrollbar,
.ss-modal-card::-webkit-scrollbar,
.ss-rail-scroll::-webkit-scrollbar,
.ss-tab-content::-webkit-scrollbar {
	width: 8px;
}

.ss-ta-list::-webkit-scrollbar-thumb,
.ss-modal-card::-webkit-scrollbar-thumb,
.ss-rail-scroll::-webkit-scrollbar-thumb,
.ss-tab-content::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.25);
	border-radius: 4px;
}

.ss-ta-list::-webkit-scrollbar-track,
.ss-modal-card::-webkit-scrollbar-track,
.ss-rail-scroll::-webkit-scrollbar-track,
.ss-tab-content::-webkit-scrollbar-track {
	background: transparent;
}

.ss-ta-list li {
	padding: 0.35em 0.75em;
	cursor: pointer;
	margin: 0;
}

.ss-ta-list li.ss-active,
.ss-ta-list li:hover {
	background: rgba(228, 76, 101, 0.25);   /* site accent tint */
	color: #ffffff;
}

.ss-ta-list li .ss-ta-count {
	float: right;
	opacity: 0.6;
	font-size: 0.85em;
}

.ss-ta-list li.ss-ta-depth-1 { padding-left: 1.75em; }
.ss-ta-list li.ss-ta-depth-2 { padding-left: 2.75em; }
.ss-ta-list li.ss-ta-depth-3 { padding-left: 3.75em; }

/* The two builder buttons share the rail width side by side (Jason
   2026-09-14, 36" monitor: at the theme's 15pt breakpoint the inline
   pair overflowed the 340px rail and the second wrapped, indented by
   its margin). Flex + gap wraps cleanly if it ever must. */
.ss-add-row {
	margin-top: 0.6em;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.ss-add-row a {
	flex: 1 1 0;
	min-width: 0;
	text-align: center;
	white-space: nowrap;
}

.ss-add-row a.ss-disabled {
	opacity: 0.4;
	pointer-events: none;
}

/* bbox summary */
.ss-bbox-summary {
	font-size: 0.85em;
	margin-left: 0.5em;
	opacity: 0.85;
}

/* ---- anonymous note (§6.4) ---------------------------------------------- */

.ss-anon-note {
	font-size: 0.85em;
	opacity: 0.85;
	padding: 0.4em 0.8em;
	border-left: 3px solid rgba(87, 114, 158, 0.6);
	margin-bottom: 1em;
}

.ss-anon-note a {
	float: right;
	border-bottom: 0;
	cursor: pointer;
}

/* ---- pathway tabs (§6.5.1) ---------------------------------------------- */

.ss-tabbar {
	display: flex;
	align-items: center;
	gap: 0.5em;
	flex-wrap: wrap;
	margin-bottom: 1em;
}

.ss-tab {
	padding: 0.45em 1.2em;
	border: 1px solid rgba(144, 144, 144, 0.5);
	border-bottom-width: 3px;
	cursor: pointer;
	font-size: 0.8em;   /* control size, see .ss-rail .button */
	background: transparent;
	color: inherit;
}

.ss-tab[aria-selected="true"] {
	border-bottom-color: #57729e;
	font-weight: bold;
}

.ss-tab.ss-dimmed {
	opacity: 0.45;
}

.ss-sort {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 0.5em;
	font-size: 0.8em;   /* control size */
}

.ss-sort select {
	width: auto;
}

/* main.css label carries display:block + margin-bottom:1em, which shoves
   the text upward inside this vertically-centered flex row. */
.ss-sort label {
	margin: 0;
}

/* ---- project hit cards (§6.5.3) ----------------------------------------- */

.ss-card {
	display: flex;
	gap: 0.9em;
	padding: 0.9em;
	border: 1px solid rgba(144, 144, 144, 0.35);
	border-radius: 4px;
	margin-bottom: 0.8em;
}

.ss-card-icon img {
	width: 34px;
	height: 34px;
	object-fit: contain;
}

.ss-card-body {
	flex: 1 1 auto;
	min-width: 0;
}

.ss-card-title {
	font-size: 1.05em;
	font-weight: bold;
}

.ss-card-title a {
	border-bottom: 0;
}

.ss-card-meta,
.ss-card-counts {
	font-size: 0.85em;
	opacity: 0.85;
	margin-top: 0.15em;
}

.ss-card-snippet {
	font-size: 0.85em;
	font-style: italic;
	margin-top: 0.4em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ss-badge-public {
	display: inline-block;
	font-size: 0.7em;
	padding: 0.1em 0.7em;
	border-radius: 999px;
	background: #43a047;
	color: #fff;
	margin-left: 0.6em;
	vertical-align: middle;
}

/* ---- image grid (§6.5.4) ------------------------------------------------ */

.ss-image-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 0.9em;
}

.ss-imgcard {
	border: 1px solid rgba(144, 144, 144, 0.35);
	border-radius: 4px;
	overflow: hidden;
	font-size: 0.82em;
}

.ss-imgcard .ss-thumbbox {
	display: block;
	aspect-ratio: 4 / 3;
	background: rgba(144, 144, 144, 0.15);
	cursor: pointer;
	border-bottom: 0;
}

.ss-imgcard .ss-thumbbox img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ss-imgcard .ss-imgcard-body {
	padding: 0.5em 0.7em;
}

.ss-imgcard .ss-imgcard-title {
	font-weight: bold;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ss-imgcard .ss-imgcard-tags,
.ss-imgcard .ss-imgcard-parent {
	opacity: 0.8;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ss-badge-annotated {
	display: inline-block;
	font-size: 0.85em;
	padding: 0 0.5em;
	border-radius: 999px;
	background: rgba(87, 114, 158, 0.25);
}

/* ---- skeleton loading (§6.4 / §6.7) ------------------------------------- */

@keyframes ss-shimmer {
	0% { opacity: 0.45; }
	50% { opacity: 0.8; }
	100% { opacity: 0.45; }
}

.ss-skel {
	border: 1px solid rgba(144, 144, 144, 0.25);
	border-radius: 4px;
	margin-bottom: 0.8em;
	height: 6em;
	background: rgba(144, 144, 144, 0.12);
	animation: ss-shimmer 1.4s infinite;
}

.ss-skel-img {
	aspect-ratio: 4 / 3;
	height: auto;
	margin-bottom: 0;
}

/* ---- empty / error states (§6.7) ---------------------------------------- */

.ss-quiet-prompt,
.ss-empty-state {
	text-align: center;
	opacity: 0.7;
	padding: 2.5em 1em;
}

.ss-error-card {
	text-align: center;
	padding: 1.5em;
	border: 1px solid #d9534f;
	border-radius: 4px;
}

/* ---- infinite scroll (§6.5.5, amended 2026-08-12) ----------------------- */

.ss-scroll-sentinel {
	height: 1px;
}

.ss-fetch-status {
	text-align: center;
	padding: 1.2em 0 1.6em;
	color: rgba(255, 255, 255, 0.55);
	min-height: 1.5em;
}

.ss-spinner {
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 2px solid rgba(255, 255, 255, 0.25);
	border-top-color: #e44c65;
	border-radius: 50%;
	animation: ss-spin 0.8s linear infinite;
	vertical-align: -0.15em;
	margin-right: 0.55em;
}

@keyframes ss-spin {
	to { transform: rotate(360deg); }
}

.ss-end-note {
	text-align: center;
	padding: 1.2em 0 1.6em;
	color: rgba(255, 255, 255, 0.45);
	font-size: 0.9em;
}

/* ---- modals (reuse grayOut backdrop, §6.1.1) ---------------------------- */

.ss-modal-card {
	position: fixed;
	z-index: 10001;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #1c1d26;   /* site dark ground — match the page, not a light card */
	color: rgba(255, 255, 255, 0.75);
	padding: 1.5em;
	border-radius: 5px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	width: min(560px, 92vw);
	max-height: 86vh;
	overflow-y: auto;
	box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}

.ss-modal-card.ss-modal-map {
	width: min(1000px, 96vw);
}

.ss-modal-card h3 {
	margin-bottom: 0.6em;
}

.ss-modal-card .ss-saved-name {
	color: #ffffff;
}

/* main.css themes only text/password/email inputs — number and date fall
   back to light browser defaults. Extend the exact site input styling
   (transparent ground, white-alpha border, accent focus) + dark widget
   chrome for the native date-picker/spinner glyphs. */
.ss-criteria input[type="number"],
.ss-criteria input[type="date"],
.ss-modal-card input[type="number"],
.ss-modal-card input[type="date"] {
	background: transparent;
	border: solid 1px rgba(255, 255, 255, 0.3);
	border-radius: 4px;
	color: inherit;
	height: 3em;
	padding: 0 1em;
	outline: 0;
	color-scheme: dark;
	transition: border-color 0.2s ease-in-out;
}

.ss-criteria input[type="number"]:focus,
.ss-criteria input[type="date"]:focus,
.ss-modal-card input[type="number"]:focus,
.ss-modal-card input[type="date"]:focus {
	border-color: #e44c65;
}

.ss-modal-actions {
	margin-top: 1em;
	display: flex;
	gap: 0.6em;
	justify-content: flex-end;
}

#ssPolyMap {
	height: min(520px, 60vh);
	border: 1px solid rgba(144, 144, 144, 0.4);
}

/* Vertex clicking is the primary interaction; signal it over Leaflet's
   default grab cursor. */
#ssPolyMap.leaflet-container {
	cursor: crosshair;
}

.ss-saved-row {
	padding: 0.7em 0;
	border-top: 1px dotted rgba(144, 144, 144, 0.4);
}

.ss-saved-row:first-child {
	border-top: 0;
}

.ss-saved-row .ss-saved-name {
	font-weight: bold;
}

.ss-saved-row .ss-saved-summary {
	font-size: 0.8em;
	opacity: 0.75;
	margin: 0.15em 0 0.35em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ss-saved-row .ss-saved-actions a {
	font-size: 0.8em;
	margin-right: 0.9em;
	cursor: pointer;
}

.ss-legacy-note {
	font-size: 0.78em;
	opacity: 0.7;
	font-style: italic;
}

/* ---- globe view (Globe View M2) ----------------------------------------- */

/* Segmented List | Globe toggle — selection styling in the tab-blue
   family (§3), pushed to the tabbar's right edge after the sort box. */
.ss-view-toggle {
	display: inline-flex;
	border: 1px solid rgba(144, 144, 144, 0.5);
	border-radius: 4px;
	overflow: hidden;
}

.ss-view-btn {
	padding: 0.35em 1.1em;
	font-size: 0.8em;   /* control size */
	background: transparent;
	color: inherit;
	border: 0;
	cursor: pointer;
}

.ss-view-btn + .ss-view-btn {
	border-left: 1px solid rgba(144, 144, 144, 0.5);
}

.ss-view-btn[aria-pressed="true"] {
	background: #57729e;
	color: #ffffff;
	font-weight: bold;
}

.ss-loc-counter {
	font-size: 0.8em;
	opacity: 0.75;
	white-space: nowrap;
}

.ss-loc-counter:empty {
	display: none;
}

/* D6: Images pathway stays list-only — the tab dims and goes inert. */
.ss-tab.ss-globe-disabled {
	opacity: 0.35;
	cursor: default;
}

/* Globe pane replaces the tab content while the tabbar stays. */
.ss-pane.ss-globe-active .ss-results {
	flex: 0 0 auto;
}

.ss-pane.ss-globe-active .ss-tab-content {
	display: none;
}

.ss-pane.ss-globe-active .ss-sort {
	display: none;   /* sort is list-view-only (§3) */
}

.ss-pane.ss-globe-active .ss-loc-counter {
	margin-left: auto;
}

.ss-globe-wrap {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	margin: 0 0 1.2em;
	border: 1px solid rgba(144, 144, 144, 0.35);
	border-radius: 4px;
	overflow: hidden;
}

.ss-globe-container {
	flex: 1 1 auto;
	min-height: 0;
}

.ss-globe-status {
	position: absolute;
	z-index: 20;
	top: 0.6em;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.8em;
	background: rgba(28, 29, 38, 0.85);
	color: rgba(255, 255, 255, 0.8);
	padding: 0.15em 0.9em;
	border-radius: 999px;
	pointer-events: none;
	white-space: nowrap;
}

.ss-globe-status:empty {
	display: none;
}

/* Point/cluster popup card — same vocabulary as .ss-card. */
.ss-globe-popup {
	position: absolute;
	z-index: 30;
	width: min(320px, 80%);
	background: #1c1d26;
	color: rgba(255, 255, 255, 0.75);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 5px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
	padding: 0.8em 0.9em;
	font-size: 0.85em;
}

.ss-gpop-head {
	display: flex;
	align-items: center;
	gap: 0.5em;
}

.ss-gpop-icon {
	width: 20px;
	height: 20px;
	object-fit: contain;
	flex: 0 0 auto;
}

.ss-gpop-title {
	font-weight: bold;
	color: #ffffff;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ss-gpop-close {
	margin-left: auto;
	border-bottom: 0;
	font-size: 1.2em;
	line-height: 1;
	cursor: pointer;
	padding: 0 0.2em;
}

.ss-gpop-meta {
	opacity: 0.8;
	margin-top: 0.3em;
}

/* Cluster popup: member-project list (unsplittable clusters). */
.ss-gpop-list {
	margin-top: 0.45em;
	max-height: 240px;
	overflow-y: auto;
}

.ss-gpop-list-row {
	display: flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.18em 0;
	min-width: 0;
}

.ss-gpop-list-row .ss-gpop-icon {
	width: 16px;
	height: 16px;
}

.ss-gpop-list-row a {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ss-gpop-links {
	margin-top: 0.55em;
	display: flex;
	gap: 1.2em;
}

.ss-gpop-links a {
	cursor: pointer;
}

/* Cesium chrome on the dark theme: compact translucent credit line. */
.ss-globe-wrap .cesium-widget-credits {
	background: rgba(28, 29, 38, 0.6);
	font-size: 10px;
}

/* ---- Zoom stack (Claire 2026-09-14) ------------------------------------ */
/* Cesium ships no zoom buttons and its home button is off, so the globe
   had no visible zoom control at all (wheel / pinch / right-drag work but
   are undiscoverable). Same convention as the site's Leaflet maps:
   + / − / fit stacked top-left. */
.ss-globe-zoom {
	position: absolute;
	z-index: 25;
	top: 0.6em;
	left: 0.6em;
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 4px;
	overflow: hidden;
	background: rgba(28, 29, 38, 0.85);
}

.ss-zoom-btn {
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	background: transparent;
	color: rgba(255, 255, 255, 0.85);
	font-size: 1.15em;
	line-height: 1;
	cursor: pointer;
}

.ss-zoom-btn + .ss-zoom-btn {
	border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ss-zoom-btn:hover {
	background: rgba(40, 42, 56, 0.95);
	color: #ffffff;
}

.ss-zoom-btn.ss-zoom-fit {
	font-size: 1em;
}

/* ---- Layers panel (M3) -------------------------------------------------- */

.ss-globe-layers {
	position: absolute;
	z-index: 25;
	top: 0.6em;
	right: 0.6em;
	text-align: right;
}

.ss-layers-btn {
	font-size: 0.8em;
	background: rgba(28, 29, 38, 0.85);
	color: rgba(255, 255, 255, 0.85);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 4px;
	padding: 0.25em 0.9em;
	cursor: pointer;
}

.ss-layers-btn:hover {
	background: rgba(40, 42, 56, 0.95);
}

.ss-layers-panel {
	margin-top: 0.4em;
	width: 215px;
	text-align: left;
	background: #1c1d26;
	color: rgba(255, 255, 255, 0.8);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 5px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
	padding: 0.7em 0.9em;
	font-size: 0.85em;
}

.ss-layers-title {
	font-weight: bold;
	color: #ffffff;
	margin: 0.45em 0 0.15em;
}

.ss-layers-group:first-child .ss-layers-title {
	margin-top: 0;
}

.ss-layers-row {
	padding: 0.1em 0;
}

.ss-layers-row label {
	margin: 0;
}

.ss-layers-opacity {
	display: flex;
	align-items: center;
	gap: 0.6em;
	padding-top: 0.25em;
}

.ss-layers-opacity label {
	margin: 0;
	font-size: 0.85em;
	opacity: 0.75;
}

.ss-layers-opacity input[type="range"] {
	flex: 1 1 auto;
	min-width: 0;
}

/* The native range track is near-invisible on the dark panel (Claire
   2026-09-14: "the slider line does not have contrast"), so draw it: a
   light track, the site's toggle blue for the filled part + thumb.
   Firefox and WebKit each need their own pseudo-elements. */
.ss-layers-opacity input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	height: 18px;
	margin: 0;
	background: transparent;
	cursor: pointer;
}

.ss-layers-opacity input[type="range"]:disabled {
	cursor: default;
	opacity: 0.4;
}

.ss-layers-opacity input[type="range"]::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.45);
}

.ss-layers-opacity input[type="range"]::-moz-range-track {
	height: 4px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.45);
}

.ss-layers-opacity input[type="range"]::-moz-range-progress {
	height: 4px;
	border-radius: 2px;
	background: #57729e;
}

.ss-layers-opacity input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	margin-top: -5px;
	border-radius: 50%;
	background: #57729e;
	border: 2px solid #ffffff;
}

.ss-layers-opacity input[type="range"]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #57729e;
	border: 2px solid #ffffff;
}

/* Current value beside the slider ("60%"), so its state reads at rest. */
.ss-layers-opacity .ss-opacity-val {
	flex: 0 0 auto;
	min-width: 2.8em;
	text-align: right;
	font-size: 0.85em;
	font-variant-numeric: tabular-nums;
	opacity: 0.85;
}

/* M5: "click the map" hint under the overlay controls. */
.ss-layers-hint {
	font-size: 0.85em;
	opacity: 0.7;
	line-height: 1.3;
	padding-top: 0.4em;
}

/* M5: geology click affordance while the overlay is on. */
.ss-globe-wrap.ss-geo-on .ss-globe-container canvas {
	cursor: crosshair;
}

/* M5: geology card. Several mapped units with descriptions can run
   tall, so this variant scrolls inside the wrap. */
.ss-globe-popup.ss-gpop-geo {
	max-height: calc(100% - 24px);
	overflow-y: auto;
}

.ss-gpop-unit {
	margin-top: 0.6em;
	padding-top: 0.5em;
	border-top: 1px dotted rgba(255, 255, 255, 0.25);
	font-weight: bold;
	color: #ffffff;
}

.ss-gpop-desc {
	margin-top: 0.3em;
	opacity: 0.8;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ss-gpop-desc.ss-gpop-desc-open {
	display: block;
	-webkit-line-clamp: unset;
}

.ss-gpop-more {
	display: inline-block;
	font-size: 0.9em;
	cursor: pointer;
}

.ss-gpop-source a {
	overflow-wrap: anywhere;
}

.ss-gpop-attrib {
	margin-top: 0.5em;
	font-size: 0.85em;
	opacity: 0.6;
}

/* Browse mode (M3): the List toggle dims and goes inert, same treatment
   as the D6 Images tab (the empty-query list stays gated). */
.ss-view-btn.ss-globe-disabled {
	opacity: 0.35;
	cursor: default;
}

.ss-quiet-prompt .ss-browse-link {
	display: inline-block;
	margin-top: 0.6em;
	cursor: pointer;
}

/* ---- subsystem triptych icons (§6.5.2) ---------------------------------- */

.ss-triptych-icon {
	width: 22px;
	height: 22px;
	object-fit: contain;
	vertical-align: middle;
	margin-right: 0.45em;
}

/* ---- responsive (§6.8) -------------------------------------------------- */
/* The builder rows are column-layout at every width now (rail); the old
   1023px/639px row re-flow rules are gone. Remaining rules are phone-only. */

@media screen and (max-width: 639px) {
	.ss-sort {
		margin-left: 0;
	}

	/* Phone tabbar: the visible "Sort" label costs the width that lets
	   the select and the List | Globe toggle share a row (M4). Keep it
	   for assistive tech. */
	.ss-sort label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.ss-modal-card {
		width: 96vw;
	}

	#ssPolyMap {
		height: 60vh;
	}

	/* ≥44px touch targets (§6.8) */
	.ss-chipbtn {
		min-height: 44px;
		min-width: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
}

/* ---- mobile drawer + full-bleed globe (Globe View M4) ------------------ */
/* Same full-viewport frame as desktop; the rail leaves the flow and slides
   in as a drawer over a dimmed backdrop (.ss-drawer-open on the frame).
   Everything is positioned INSIDE the frame (position: relative), never
   fixed to the viewport: the site nav slides #page-wrapper with a
   transform on phones, which would re-anchor fixed descendants. */
@media screen and (max-width: 1023px) {
	body {
		overflow: hidden;
	}

	.ss-app-frame {
		position: relative;
		flex-direction: row;
		height: calc(100vh - 3.5em);   /* below the fixed #header */
		height: calc(100dvh - 3.5em);
		overflow: hidden;
	}

	.ss-rail {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		width: min(320px, 88vw);
		z-index: 60;
		border-right: 1px solid rgba(255, 255, 255, 0.2);
		box-shadow: 6px 0 30px rgba(0, 0, 0, 0.6);
		transform: translateX(-110%);
		visibility: hidden;   /* closed drawer is unreachable by keyboard/AT */
		transition: transform 0.25s ease, visibility 0s linear 0.25s;
	}

	.ss-app-frame.ss-drawer-open .ss-rail {
		transform: none;
		visibility: visible;
		transition: transform 0.25s ease;
	}

	.ss-rail-scroll {
		flex: 1 1 auto;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.ss-rail-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin-right: -0.7em;
		background: transparent;
		border: 0;
		color: rgba(255, 255, 255, 0.85);
		font-size: 1.9em;
		line-height: 1;
		cursor: pointer;
	}

	.ss-drawer-close-link {
		display: block;
		text-align: center;
		margin-top: 0.6em;
		min-height: 44px;
		line-height: 44px;
		font-size: 0.95em;
	}

	.ss-drawer-backdrop {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 55;
		background: rgba(0, 0, 0, 0.55);
	}

	.ss-app-frame.ss-drawer-open .ss-drawer-backdrop {
		display: block;
	}

	.ss-pane {
		position: relative;
		height: 100%;
	}

	/* List view: the tab content scrolls internally; bottom padding keeps
	   the last card clear of the Filters pill. */
	.ss-results .ss-tab-content {
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 5em;
	}

	.ss-filters-pill,
	.ss-count-pill {
		position: absolute;
		bottom: 20px;
		z-index: 40;
		display: inline-flex;
		align-items: center;
		gap: 0.5em;
		min-height: 44px;
		padding: 0 1.2em;
		border-radius: 999px;
		background: rgba(28, 29, 38, 0.92);
		color: rgba(255, 255, 255, 0.9);
		border: 1px solid rgba(255, 255, 255, 0.3);
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
		font-size: 0.8em;   /* control size */
		white-space: nowrap;
	}

	.ss-filters-pill {
		left: 16px;
		cursor: pointer;
	}

	.ss-filters-badge {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 1.6em;
		height: 1.6em;
		padding: 0 0.4em;
		border-radius: 999px;
		background: #57729e;
		color: #ffffff;
		font-size: 0.8em;
		font-weight: bold;
	}

	.ss-count-pill {
		right: 16px;
	}

	.ss-count-pill a {
		color: #ed7287;
		cursor: pointer;
	}

	/* Globe view: full-bleed pane; the tabbar hides (its toggle + counter
	   reappear pinned over the globe). */
	.ss-pane.ss-globe-active .ss-results {
		display: none;
	}

	.ss-globe-wrap {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		margin: 0;
		border: 0;
		border-radius: 0;
	}

	.ss-view-toggle.ss-globe-toggle {
		display: inline-flex;
		position: absolute;
		z-index: 40;
		top: 12px;
		left: 50%;
		transform: translateX(-50%);
		background: rgba(28, 29, 38, 0.85);
		border-color: rgba(255, 255, 255, 0.3);
	}

	.ss-globe-toggle .ss-view-btn {
		min-height: 44px;
		padding: 0 1.3em;
	}

	.ss-globe-status {
		top: 66px;   /* below the pinned toggle */
	}

	.ss-globe-layers {
		top: 12px;
	}

	.ss-globe-zoom {
		top: 12px;
		left: 12px;
	}

	.ss-zoom-btn {
		width: 44px;
		height: 44px;
	}

	.ss-layers-btn {
		min-height: 44px;
		padding: 0 1em;
	}

	/* Cesium credit line clears the bottom pills (the Viewer sets its
	   bottom offset inline, hence !important). */
	.ss-globe-wrap .cesium-viewer-bottom {
		bottom: 74px !important;
	}

	/* Phone tabbar (list view): tabs row, then sort + toggle on one row. */
	.ss-results .ss-view-toggle {
		margin-left: auto;
	}
}

/* The site swaps the 3.5em #header for the 44px #titleBar at 950px. */
@media screen and (max-width: 950px) {
	.ss-app-frame {
		height: calc(100vh - 44px);
		height: calc(100dvh - 44px);
	}
}

/* Phones: the globe popup becomes a bottom sheet (globe.js adds the
   class instead of clamping near the tap). */
@media screen and (max-width: 639px) {
	.ss-globe-popup.ss-gpop-sheet {
		left: 0;
		right: 0;
		top: auto;
		bottom: 0;
		width: auto;
		max-height: 60%;
		overflow-y: auto;
		z-index: 45;
		border-radius: 12px 12px 0 0;
		border-bottom: 0;
		padding-bottom: 1.2em;
	}
}
