/* Spectrum Toolkit page (tools/spectrum-toolkit.html, assets/js/spectrum-toolkit-page.js).
   Same look as the Spectrum Explorer: white cards, coral #f56565, dark navy figure card, pill buttons. */

/* The glide when the figure changes size: one duration and curve for both columns, so they move together.
   The curve starts gently, glides, and settles slowly at the end. */
.stk-app { --stk-glide: 0.7s cubic-bezier(0.4, 0, 0.2, 1); --stk-fade: 0.5s ease; }

/* The site's button style sets display, which would override the browser's "hidden" switch */
.stk-app [hidden] { display: none !important; }

/* The site styles every <button> as a large uppercase outline button; these are plain controls */
.stk-app button {
	box-shadow: none;
	font-family: "Open Sans", sans-serif;
	height: auto;
	letter-spacing: 0;
	line-height: 1.45;
	text-transform: none;
	white-space: normal;
}
.stk-app select, .stk-app input[type="text"], .stk-app input[type="number"], .stk-app input[type="search"] {
	font-size: 0.85em;
	height: 2.4em;
}
.stk-intro { max-width: 46em; }
/* Number boxes look like the site's text boxes */
.stk-app input[type="number"] {
	appearance: textfield;
	background: #fff;
	border: solid 1px rgba(210, 215, 217, 0.75);
	border-radius: 0.375em;
	color: inherit;
	padding: 0 0.75em;
	width: 100%;
}
.stk-app input[type="number"]:focus { border-color: #f56565; box-shadow: 0 0 0 1px #f56565; outline: none; }

/* ---------- Layout: data on top, figure left, settings right ---------- */
.stk-app {
	align-items: start;
	display: grid;
	gap: 1.4em;
	grid-template-areas: "data data" "figure settings";
	grid-template-columns: minmax(0, 1fr) 330px;
}
.stk-area-data { grid-area: data; }
/* Left column: the figure, then a card that fills the space down to the settings card's bottom (set by the script) */
.stk-area-figure { display: flex; flex-direction: column; gap: 1.4em; grid-area: figure; }
.stk-area-settings { grid-area: settings; }

/* ---------- 1. Data ---------- */
.stk-data {
	align-items: stretch;
	background: #fff;
	border: 1px solid rgba(210, 215, 217, 0.75);
	border-radius: 12px;
	box-shadow: 0 4px 18px rgba(61, 68, 73, 0.06);
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	padding: 1.1em 1.2em;
}
.stk-drop {
	align-items: center;
	border: 1.5px dashed rgba(245, 101, 101, 0.55);
	border-radius: 10px;
	color: #3d4449;
	cursor: pointer;
	display: flex;
	flex: 1 1 22em;
	flex-wrap: wrap;
	gap: 0.2em 0.9em;
	margin: 0;
	padding: 0.9em 1.1em;
	transition: background-color 0.2s, border-color 0.2s;
}
.stk-drop:hover, .stk-drop:focus-within, .stk-drop.is-over { background: rgba(245, 101, 101, 0.05); border-color: #f56565; }
.stk-drop.is-over { border-style: solid; }
.stk-drop-icon { color: #f56565; font-size: 1.6em; }
.stk-drop-text { font-size: 0.95em; }
.stk-drop-text u { color: #f56565; text-decoration: none; border-bottom: 1px solid rgba(245, 101, 101, 0.5); }
.stk-drop-formats { color: #7f888f; flex-basis: 100%; font-size: 0.75em; padding-left: 2.6em; }
.stk-data-side { align-items: flex-start; display: flex; flex: 0 1 15em; flex-direction: column; gap: 0.5em; justify-content: center; }
.stk-example {
	background: #f5f6f7;
	border: 1px solid rgba(210, 215, 217, 0.75);
	border-radius: 999px;
	color: #3d4449 !important;
	cursor: pointer;
	font-size: 0.85em;
	font-weight: 600;
	padding: 0.45em 1.1em;
	transition: border-color 0.2s, color 0.2s;
}
.stk-example:hover, .stk-example:focus-visible { border-color: #f56565; color: #f56565 !important; outline: none; }
.stk-example .icon { margin-right: 0.3em; }
.stk-privacy { color: #7f888f; font-size: 0.72em; line-height: 1.4; margin: 0; }
.stk-privacy .icon { margin-right: 0.25em; }

/* After a file is read: its name and size, what was read, and (for .mat files) the variables */
.stk-data.is-loaded .stk-drop, .stk-data.is-loaded .stk-data-side { display: none; }
.stk-loaded { flex: 1 1 100%; }
.stk-loaded-main { align-items: center; display: flex; gap: 0.7em; }
.stk-loaded-icon { color: #2fb5a9; font-size: 1.3em; }
.stk-loaded-main strong { display: block; font-family: "Roboto Slab", serif; }
.stk-loaded-meta { color: #7f888f; font-size: 0.8em; }
.stk-loaded-actions { display: flex; gap: 1.2em; margin: 0.35em 0 0 2.05em; }
.stk-link {
	background: none;
	border: 0;
	color: #f56565 !important;
	cursor: pointer;
	font-size: 0.78em;
	font-weight: 600;
	padding: 0;
}
.stk-link:hover { text-decoration: underline; }
.stk-notes { color: #5f676d; font-size: 0.78em; line-height: 1.5; margin: 0.6em 0 0 2.05em; padding-left: 1.1em; }
.stk-notes li { margin: 0.1em 0; }
.stk-data-message { color: #b54747; flex-basis: 100%; font-size: 0.85em; line-height: 1.5; }
.stk-data .chem-loader { flex-basis: 100%; padding: 0.4em 0; }

/* .mat variables: a small table to choose x and the spectra */
.stk-variables { margin: 0.8em 0 0 2.05em; }
.stk-variables p { color: #5f676d; font-size: 0.8em; margin: 0 0 0.4em; }
.stk-variables table { font-size: 0.8em; margin: 0 0 0.5em; width: auto; }
.stk-variables th, .stk-variables td { padding: 0.3em 0.9em 0.3em 0; text-align: left; }
.stk-variables td input { margin-right: 0.3em; }
.stk-variables .button { font-size: 0.7em; height: 2.6em; line-height: 2.6em; padding: 0 1.4em; }

/* ---------- 2. Figure card: the white figure sits on the dark card like a sheet of paper ---------- */
.stk-figure-card {
	background: linear-gradient(140deg, #26334d 0%, #3b4378 55%, #5b67c9 100%);
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(59, 67, 120, 0.3);
	color: #fff;
	padding: 1.2em 1.3em 1em;
}
.stk-figure-head { align-items: flex-start; display: flex; flex-wrap: wrap; gap: 0.6em 1em; justify-content: space-between; }
.stk-figure-head h2 { color: #fff; font-size: 1.35em; margin: 0; overflow-wrap: anywhere; }
.stk-subtitle { color: rgba(255, 255, 255, 0.75); font-size: 0.82em; margin-top: 0.15em; }
/* Undo / redo and the plot kinds, side by side in the header */
.stk-head-tools { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5em; }
.stk-history { background: rgba(0, 0, 0, 0.18); border-radius: 999px; display: inline-flex; gap: 2px; padding: 3px; }
.stk-history button {
	align-items: center; background: none; border: 0; border-radius: 999px; color: rgba(255, 255, 255, 0.8) !important; cursor: pointer;
	display: inline-flex; font-size: 0.72em; height: 2.15em !important; justify-content: center; padding: 0; transition: background-color 0.2s, color 0.2s; width: 2.6em;
}
.stk-history button:hover:not([disabled]), .stk-history button:focus-visible { background: rgba(255, 255, 255, 0.16); color: #fff !important; outline: none; }
.stk-history button[disabled] { color: rgba(255, 255, 255, 0.3) !important; cursor: default; }
.stk-kinds { background: rgba(0, 0, 0, 0.18); border-radius: 999px; display: inline-flex; padding: 3px; }
.stk-kinds button {
	background: none;
	border: 0;
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.7) !important;
	cursor: pointer;
	font-size: 0.75em;
	font-weight: 600;
	padding: 0.3em 0.95em;
	transition: background-color 0.2s, color 0.2s;
}
.stk-kinds button[aria-pressed="true"] { background: #fff; color: #26334d !important; }
.stk-kinds button:hover:not([aria-pressed="true"]) { color: #fff !important; }
.stk-paper {
	align-items: center;
	background: rgba(255, 255, 255, 0.06);
	border-radius: 10px;
	display: flex;
	justify-content: center;
	margin-top: 0.9em;
	min-height: 260px;
	overflow: hidden;                                       /* while the height glides, the picture stays inside */
	padding: 1em;
	position: relative;
	transition: height var(--stk-glide);                    /* glides when the picture changes size */
}
.stk-paper img {
	background: #fff;
	border-radius: 3px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	display: block;
	height: auto;
	max-height: 62vh;
	max-width: 100%;
	transition: opacity var(--stk-fade);                    /* a new picture fades in */
}
.stk-paper img.is-new { opacity: 0.35; transition: none; }  /* a new picture starts faint, then fades in */
.stk-paper.is-updating img { opacity: 0.82; }
.stk-paper-message { color: rgba(255, 255, 255, 0.85); font-size: 0.9em; text-align: center; }
/* Maps: the layer over the picture (crosshair, readout, pinned positions) and the pinned positions under it */
.stk-map-over { pointer-events: none; position: absolute; }
.stk-map-cross { background: rgba(255, 255, 255, 0.75); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); position: absolute; }
.stk-map-cross.is-v { width: 1px; }
.stk-map-cross.is-h { height: 1px; }
.stk-map-tip { background: rgba(20, 24, 30, 0.86); border-radius: 6px; color: #fff; font-size: 0.72em; padding: 0.25em 0.6em; position: absolute; white-space: nowrap; }
.stk-map-pin { border: 2px solid #f56565; border-radius: 50%; box-shadow: 0 0 0 1px #fff; height: 12px; margin: -6px 0 0 -6px; position: absolute; width: 12px; }
.stk-map-pin.is-starred { border-width: 3px; height: 16px; margin: -8px 0 0 -8px; width: 16px; }
.stk-map-pins { background: #fff; border-radius: 10px; color: #3d4449; margin-top: 0.7em; padding: 0.6em 0.8em; }
.stk-map-pins-head { align-items: baseline; display: flex; gap: 0.7em; }
.stk-map-pins-head strong { font-size: 0.8em; }
.stk-map-pins-head small { color: #7f888f; flex: 1 1 auto; font-size: 0.68em; }
.stk-map-pins-body { display: grid; gap: 0.8em; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); margin-top: 0.4em; }
.stk-map-pin-list { list-style: none; margin: 0; padding: 0; }
.stk-map-pin-list li { align-items: center; display: grid; font-size: 0.72em; gap: 0.5em; grid-template-columns: 0.7em minmax(0, 1fr) auto auto auto auto; padding: 0.2em 0; }
.stk-map-dot { border-radius: 50%; display: inline-block; height: 0.7em; width: 0.7em; }
.stk-map-pin-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-map-pin-value { color: #6b7378; font-variant-numeric: tabular-nums; }
.stk-map-pin-list .stk-link.is-on { font-weight: 700; }
.stk-map-pin-list .stk-pop-close { font-size: 1em; line-height: 1; padding: 0 0.2em; }
.stk-map-spectra svg { display: block; height: 8.5em; width: 100%; }
.stk-map-set { margin-bottom: 0.8em; }
.stk-wl { margin: 0 0 0.8em; }
.stk-wl-pic { line-height: 0; max-width: 18em; position: relative; }
.stk-wl-pic img { border-radius: 4px; width: 100%; }
.stk-wl-pic svg { height: 100%; left: 0; position: absolute; top: 0; width: 100%; }
.stk-wl figcaption { color: #7f888f; font-size: 0.68em; margin-top: 0.3em; }
@media screen and (max-width: 736px) { .stk-map-pins-body { grid-template-columns: 1fr; } }
.stk-paper-message .chem-loader { color: rgba(255, 255, 255, 0.85); }
.stk-figure-foot { align-items: center; display: flex; flex-wrap: wrap; gap: 0.6em; justify-content: space-between; margin-top: 0.8em; }
.stk-status { align-items: center; color: rgba(255, 255, 255, 0.7); display: inline-flex; flex: 1 1 0; font-size: 0.75em; gap: 0.5em; min-width: 0; }
/* always one line: a message that does not fit ends with "…" (the whole text is in its tooltip) */
.stk-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-status i { background: #2fb5a9; border-radius: 50%; flex: 0 0 0.55em; height: 0.55em; }
.stk-status.is-busy i { animation: stk-pulse 0.9s ease-in-out infinite; background: #ffd27a; }
.stk-status.is-error { color: #ffd6d6; }
.stk-status.is-error i { background: #f56565; }
@keyframes stk-pulse { 50% { opacity: 0.3; } }
.stk-export { display: flex; flex-wrap: wrap; gap: 0.4em; }
.stk-export select {
	background-color: rgba(255, 255, 255, 0.12);
	/* the site's arrow is pale grey for white boxes; on the dark card a light arrow, smaller, with room kept for it */
	background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M9.4,12.3l10.4,10.4l10.4-10.4c0.5-0.5,1.3-0.5,1.8,0l3.3,3.3c0.5,0.5,0.5,1.3,0,1.8L20.7,31.9c-0.5,0.5-1.3,0.5-1.8,0L4.3,17.3c-0.5-0.5-0.5-1.3,0-1.8l3.3-3.3C8.1,11.8,8.9,11.8,9.4,12.3z' fill='rgba(255, 255, 255, 0.8)' /%3E%3C/svg%3E");
	background-position: right 0.65em center;
	background-size: 0.85em;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 6px;
	color: #fff;
	font-size: 0.75em;
	height: 2.3em;
	padding: 0 2.2em 0 0.75em;                              /* the text stops before the arrow */
	width: auto;
}
.stk-export select:hover, .stk-export select:focus { background-color: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.45); }
/* each wide enough for its longest choice plus the arrow, the same in every browser */
#stk-format { min-width: 6.2em; }                        /* TIFF */
#stk-dpi { min-width: 8em; }                             /* 1200 dpi */
#stk-cmyk { min-width: 6.6em; }                          /* CMYK */
.stk-export select option { color: #3d4449; }
.stk-download {
	background: #f56565;
	border: 0;
	border-radius: 6px;
	color: #fff !important;
	cursor: pointer;
	font-size: 0.78em;
	font-weight: 700;
	padding: 0.45em 1.1em;
	transition: background-color 0.2s;
}
.stk-download:hover, .stk-download:focus-visible { background: #e04f4f; outline: none; }
.stk-download[disabled] { cursor: wait; opacity: 0.7; }
/* Transparent background: a switch shaped like the boxes beside it (shown only for file types that keep it) */
.stk-export .stk-transparent { align-self: stretch; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 6px; gap: 0.5em; padding: 0 0.65em; }   /* as tall as the boxes beside it, at any width */
.stk-export .stk-transparent[hidden] { display: none; }
.stk-export .stk-transparent span { color: #fff; font-size: 0.75em; font-weight: 400; }
.stk-export .stk-transparent input { background: rgba(255, 255, 255, 0.3); flex-basis: 1.9em; height: 1.1em; width: 1.9em; }
.stk-export .stk-transparent input::after { height: 0.8em; width: 0.8em; }
.stk-export .stk-transparent input:checked { background: #f56565; }
.stk-export .stk-transparent input:checked::after { transform: translateX(0.8em); }

/* ---------- 3. Settings ---------- */
.stk-settings {
	background: #fff;
	border: 1px solid rgba(210, 215, 217, 0.75);
	border-radius: 12px;
	box-shadow: 0 4px 18px rgba(61, 68, 73, 0.06);
	padding: 1em 1.1em 1.1em;
}
.stk-style-row { align-items: center; display: flex; gap: 0.4em; }
.stk-style-row label { color: #7f888f; font-size: 0.78em; font-weight: 600; margin: 0 0.2em 0 0; }
.stk-style-row select { flex: 1; min-width: 0; }
.stk-icon-button {
	background: #f5f6f7;
	border: 1px solid rgba(210, 215, 217, 0.75);
	border-radius: 8px;
	color: #3d4449 !important;
	cursor: pointer;
	flex: 0 0 2.4em;
	font-size: 0.85em;
	height: 2.4em !important;
	padding: 0;
	width: 2.4em;
}
.stk-icon-button:hover, .stk-icon-button:focus-visible { border-color: #f56565; color: #f56565 !important; outline: none; }
.stk-menu-wrap { position: relative; }
.stk-menu {
	background: #fff;
	border: 1px solid rgba(210, 215, 217, 0.9);
	border-radius: 8px;
	box-shadow: 0 12px 28px rgba(61, 68, 73, 0.14);
	list-style: none;
	margin: 0.3em 0 0;
	min-width: 13em;
	padding: 0.3em 0;
	position: absolute;
	right: 0;
	z-index: 30;
}
.stk-menu li { margin: 0; padding: 0; }
.stk-menu button {
	background: none;
	border: 0;
	color: #3d4449 !important;
	cursor: pointer;
	display: block;
	font-size: 0.82em;
	padding: 0.45em 1em;
	text-align: left;
	width: 100%;
}
.stk-menu button:hover, .stk-menu button:focus-visible { background: rgba(245, 101, 101, 0.08); color: #f56565 !important; outline: none; }
.stk-menu button[disabled] { color: #b8bec2 !important; cursor: default; background: none; }
.stk-menu-danger { border-top: 1px solid rgba(210, 215, 217, 0.6); margin-top: 0.3em !important; padding-top: 0.3em !important; }
.stk-menu-danger button { color: #c53d3d !important; }
.stk-style-note { color: #7f888f; font-size: 0.74em; line-height: 1.4; margin: 0.4em 0 0.8em; min-height: 1em; }
.stk-style-note.is-error { color: #b54747; }

/* One control: its name, the control, a reset button when changed, an error under it */
.stk-row { margin: 0 0 0.85em; }
.stk-row-head { align-items: baseline; display: flex; gap: 0.5em; justify-content: space-between; margin-bottom: 0.3em; }
.stk-row-head label { color: #3d4449; font-size: 0.8em; font-weight: 600; margin: 0; }
.stk-row-head output { color: #7f888f; font-size: 0.75em; font-variant-numeric: tabular-nums; }
/* changed: a small dot before the name; click it to go back to the style's value */
.stk-reset { background: transparent; border: 0; border-radius: 50%; box-shadow: none; cursor: pointer; flex: 0 0 auto; height: 0.5em !important;
	line-height: 0 !important; margin: 0 0.1em 0 -0.75em; padding: 0 !important; visibility: hidden; width: 0.5em; }
.stk-row.is-changed .stk-reset { background: #f56565; visibility: visible; }
.stk-row.is-changed .stk-reset:hover { box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.25); }
/* (i): opens the setting's explanation */
.stk-info { align-items: center; background: none; border: 1px solid #d2d7d9; border-radius: 50%; box-shadow: none; color: #9aa1a6 !important; cursor: help;
	display: inline-flex; flex: 0 0 auto; font: italic 700 0.6em Georgia, serif; height: 1.35em !important; justify-content: center; line-height: 1 !important;
	padding: 0 !important; width: 1.35em; }
.stk-info:hover { border-color: #f56565; color: #f56565 !important; }
.stk-meaning { color: #9aa1a6; font-size: 0.72em; line-height: 1.35; margin: 0.25em 0 0; }
/* the bubble an (i) opens */
.stk-bubble { background: #fff; border: 1px solid #e3e6e8; border-radius: 8px; box-shadow: 0 6px 18px rgba(61, 68, 73, 0.14); color: #5f676d; font-size: 0.74em;
	line-height: 1.45; max-width: 18em; padding: 0.55em 0.75em; position: absolute; z-index: 60; }
/* An (i) next to a title or label sits on the middle of its text, as in the settings rows: the label is a flex row */
.stk-extra-head h3, .stk-pop-head strong, .stk-pr-head h4, .stk-pr-name { align-items: center; display: inline-flex; line-height: 1.25; }
.stk-extra-head h3 .stk-info, .stk-pop-head strong .stk-info, .stk-pr-head h4 .stk-info { margin-left: 0.45em; }
.stk-extra-head h3 .stk-info { position: relative; top: -0.04em; }   /* the heading font sits a little high in its box */
.stk-pr-name .stk-info { margin-left: 0.35em; }
/* a slider with a box to type the value, and its unit */
.stk-numrow { align-items: center; display: flex; gap: 0.45em; min-width: 0; }
.stk-numrow input[type="range"] { flex: 1 1 auto; min-width: 3em; }
.stk-numrow .stk-seg { flex: 1 1 auto; min-width: 0; }
/* no up/down arrows inside the boxes: they take the room the number needs */
.stk-row .stk-num { -moz-appearance: textfield; appearance: textfield; }
.stk-row .stk-num::-webkit-inner-spin-button, .stk-row .stk-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stk-row .stk-num { flex: 0 0 4.3em; font-size: 0.74em !important; height: 1.95em !important; padding: 0 0.45em !important; text-align: right; width: 4.3em; }
.stk-row input[type="color"].is-auto { opacity: 0.35; }                       /* follows another colour */
.stk-row-body > .stk-num { flex: none; max-width: 6em; width: 6em !important; }   /* a number on its own: compact */
.stk-unit { color: #9aa1a6; flex: 0 0 auto; font-size: 0.66em; white-space: nowrap; }
/* the plot kind's own groups (e.g. Stacking): first in their tab, lightly marked */
.stk-group.is-kind { background: rgba(245, 101, 101, 0.045); border-radius: 8px; padding: 0.55em 0.6em 0.3em; }
.stk-group.is-kind + .stk-group { border-top: 0; }
.stk-kind-tag { background: rgba(245, 101, 101, 0.14); border-radius: 999px; color: #e04f4f; font-size: 0.92em; letter-spacing: 0.02em; margin-left: 0.6em;
	padding: 0.1em 0.55em; text-transform: none; }
/* colour maps as chips */
.stk-cmaps { display: grid; gap: 0.3em; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stk-cmaps button { background: #fff !important; border: 1px solid #e3e6e8 !important; border-radius: 6px; box-shadow: none; color: #5f676d !important; cursor: pointer;
	font-size: 0.62em; height: auto !important; line-height: 1.2 !important; padding: 0.3em 0.2em !important; text-transform: none; }
.stk-cmaps button b { border-radius: 3px; display: block; height: 0.7em; margin-bottom: 0.2em; }
.stk-cmaps button[aria-pressed="true"] { border-color: #f56565 !important; box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.18); color: #e04f4f !important; }
/* groups fold open and closed (click the title); the first three of a tab start open */
.stk-controls .stk-group-title { align-items: center; cursor: pointer; display: flex; user-select: none; }
.stk-controls .stk-group-title::after { border: solid #b4babe; border-width: 0 2px 2px 0; content: ""; height: 0.45em; margin-left: auto; transform: rotate(45deg); transition: transform 0.2s; width: 0.45em; }
.stk-controls .stk-group.is-folded .stk-group-title::after { transform: rotate(-45deg); }
.stk-controls .stk-group.is-folded > :not(.stk-group-title) { display: none; }
.stk-controls .stk-group.is-folded .stk-group-title { margin-bottom: 0; }
.stk-row-error { color: #c53d3d; font-size: 0.74em; line-height: 1.35; margin: 0.3em 0 0; }
.stk-row.has-error input, .stk-row.has-error select { border-color: #f56565; box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.15); }
.stk-pair { display: flex; gap: 0.4em; }
.stk-pair > * { flex: 1; min-width: 0; }
/* Sliders: the site leaves them without a track, so draw one (coral thumb on a light grey track) */
.stk-row input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; height: 1.3em; padding: 0; width: 100%; }
.stk-row input[type="range"]::-webkit-slider-runnable-track { background: #e3e6e8; border-radius: 2px; height: 4px; }
.stk-row input[type="range"]::-moz-range-track { background: #e3e6e8; border-radius: 2px; height: 4px; }
.stk-row input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none; background: #f56565; border: 2px solid #fff; border-radius: 50%;
	box-shadow: 0 1px 4px rgba(61, 68, 73, 0.35); height: 16px; margin-top: -6px; width: 16px;
}
.stk-row input[type="range"]::-moz-range-thumb { background: #f56565; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(61, 68, 73, 0.35); height: 12px; width: 12px; }
.stk-row input[type="range"]:focus-visible { outline: none; }
.stk-row input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.3); }
.stk-panel .chem-loader { padding: 1.5em 0; }
.stk-row input[type="color"] { background: none; border: 1px solid rgba(210, 215, 217, 0.9); border-radius: 6px; height: 2.2em; padding: 2px; width: 3.2em; }

/* Segmented choice (a few options side by side) */
.stk-seg { background: #f5f6f7; border-radius: 999px; display: flex; padding: 3px; }
.stk-seg button {
	background: none;
	border: 0;
	border-radius: 999px;
	color: #5f676d !important;
	cursor: pointer;
	flex: 1;
	font-size: 0.76em;
	font-weight: 600;
	padding: 0.3em 0.4em;
	transition: background-color 0.2s, color 0.2s;
}
.stk-seg button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 4px rgba(61, 68, 73, 0.15); color: #f56565 !important; }
/* On / off switch */
.stk-switch { align-items: center; cursor: pointer; display: flex; justify-content: space-between; margin: 0; }
.stk-switch span { color: #3d4449; font-size: 0.8em; font-weight: 600; }
/* the site hides checkboxes (it draws its own); this one is drawn as a switch, so it must show */
.stk-switch input[type="checkbox"] { display: block; float: none; margin: 0; opacity: 1; z-index: auto; }
.stk-switch input { appearance: none; background: #d2d7d9; border-radius: 999px; cursor: pointer; flex: 0 0 2.2em; height: 1.25em; margin: 0; opacity: 1; position: relative; transition: background-color 0.2s; width: 2.2em; }
.stk-switch input::after { background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); content: ""; height: 0.95em; left: 0.15em; position: absolute; top: 0.15em; transition: transform 0.2s; width: 0.95em; }
.stk-switch input:checked { background: #f56565; }
.stk-switch input:checked::after { transform: translateX(0.95em); }
/* Palette swatches */
.stk-palettes { display: grid; gap: 0.35em; grid-template-columns: repeat(2, 1fr); }
.stk-palettes button {
	align-items: center;
	background: #fff;
	border: 1px solid rgba(210, 215, 217, 0.9);
	border-radius: 8px;
	color: #3d4449 !important;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	font-size: 0.72em;
	gap: 0.3em;
	padding: 0.4em 0.3em;
}
.stk-palettes button[aria-pressed="true"] { border-color: #f56565; box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.18); }
.stk-palettes b { display: flex; gap: 2px; }
.stk-palettes b i { border-radius: 2px; display: block; height: 0.7em; width: 0.9em; }

/* Find any setting */
.stk-find { align-items: center; border-top: 1px solid rgba(210, 215, 217, 0.6); display: flex; gap: 0.5em; margin-top: 0.4em; padding-top: 0.9em; }
.stk-find .icon { color: #7f888f; font-size: 0.8em; }
.stk-find input { flex: 1; }
.stk-found { margin-top: 0.8em; max-height: 22em; overflow-y: auto; padding-right: 0.2em; }
.stk-found .stk-meaning { color: #7f888f; font-size: 0.72em; line-height: 1.35; margin: 0.25em 0 0; }
.stk-found-empty { color: #7f888f; font-size: 0.78em; }
.stk-changed { color: #7f888f; font-size: 0.72em; margin-top: 0.8em; }
.stk-changed button { font-size: 1em; }

/* ---------- Settings: compact rows in named groups ---------- */
.stk-controls { margin-top: 0.2em; }
.stk-c-row { align-items: center; column-gap: 0.7em; display: grid; grid-template-columns: 7.6em minmax(0, 1fr); margin: 0 0 0.55em; }
.stk-c-row .stk-row-head { align-items: center; flex-direction: row; gap: 0.35em; justify-content: flex-start; margin: 0; min-width: 0; }
.stk-c-row .stk-row-head label { font-size: 0.78em; font-weight: 600; line-height: 1.25; }
.stk-c-row .stk-row-head output { font-size: 0.7em; line-height: 1.2; }
.stk-c-row .stk-row-error, .stk-c-row .stk-meaning { grid-column: 1 / -1; }
.stk-c-row.is-wide { grid-template-columns: minmax(0, 1fr); row-gap: 0.3em; }
.stk-c-row.is-wide .stk-row-head { align-items: center; flex-direction: row; gap: 0.35em; justify-content: flex-start; }
.stk-c-row .stk-switch span { color: #7f888f; font-size: 0.75em; font-weight: 400; }
.stk-c-row .stk-seg button { font-size: 0.72em; padding: 0.28em 0.3em; }
.stk-c-row select, .stk-c-row input[type="text"], .stk-c-row input[type="number"] { font-size: 0.8em; height: 2.2em; }
.stk-c-row .stk-palettes { grid-template-columns: repeat(3, 1fr); }
.stk-c-row .stk-palettes button { font-size: 0.66em; padding: 0.35em 0.2em; }
.stk-group { padding: 0.1em 0 0.2em; }
.stk-group + .stk-group { border-top: 1px solid #eef0f1; margin-top: 0.35em; padding-top: 0.65em; }
.stk-group-title { color: #9aa1a6; font-family: "Open Sans", sans-serif; font-size: 0.66em; font-weight: 700; letter-spacing: 0.09em; margin: 0 0 0.55em; text-transform: uppercase; }
.stk-badge {
	background: #f56565; border-radius: 999px; color: #fff; display: inline-block; font-size: 0.68em; font-weight: 700;
	line-height: 1.5em; margin-left: 0.35em; min-width: 1.5em; padding: 0 0.35em; text-align: center; vertical-align: 0.1em;
}
.stk-stepper { align-items: center; display: inline-flex; gap: 0.5em; }
.stk-stepper button {
	background: #f5f6f7; border: 1px solid rgba(210, 215, 217, 0.9); border-radius: 6px; color: #3d4449 !important; cursor: pointer;
	font-size: 0.9em; font-weight: 700; height: 1.9em !important; line-height: 1 !important; padding: 0; width: 1.9em;
}
.stk-stepper button:hover { border-color: #f56565; color: #f56565 !important; }
.stk-step-value { color: #3d4449; font-size: 0.8em; min-width: 4.5em; text-align: center; }

/* The open category has a fixed height and scrolls inside (as in design E), so switching tabs never
   changes the page's height and the page never jumps */
/* the settings card is a column: when the script makes it taller (to end level with the left column),
   the extra height goes to the controls area, so more settings show before scrolling */
.stk-settings { display: flex; flex-direction: column; transition: height var(--stk-glide); }   /* glides with the figure */
.stk-controls { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.stk-controls .stk-cat-body {
	flex: 1 1 auto;
	height: clamp(340px, 52vh, 560px);
	min-height: 180px;                                     /* may shrink when the figure is short; it scrolls */
	overflow-y: auto;
	padding-right: 0.45em;
	scrollbar-color: rgba(127, 136, 143, 0.35) transparent;
	scrollbar-width: thin;
}

/* Six tabs, each an icon above its name. They share the width
   equally, so the row never needs to scroll; if a very narrow screen ever makes it scroll, the space
   under the buttons keeps the scrollbar below them, off the buttons. */
.stk-icon-tabs {
	border-bottom: 1px solid #eef0f1;
	display: grid;
	gap: 0.2em;
	grid-template-columns: repeat(6, minmax(2.9em, 1fr));
	margin: 0 0 0.85em;
	overflow-x: auto;
	padding: 0 0 0.45em;
}
.stk-icon-tabs button {
	align-items: center; background: none; border: 0; border-radius: 8px; color: #7f888f !important; cursor: pointer; display: flex;
	flex-direction: column; gap: 0.15em; padding: 0.5em 0.1em; position: relative;
}
.stk-icon-tabs button .icon { font-size: 0.95em; }
.stk-icon-tabs button small { font-size: 0.6em; font-weight: 600; }
.stk-icon-tabs button:hover { color: #3d4449 !important; }
.stk-icon-tabs button[aria-selected="true"] { background: rgba(245, 101, 101, 0.1); color: #f56565 !important; }
.stk-icon-tabs .stk-badge { position: absolute; right: 0; top: 0.1em; }

/* ---------- The card under the figure: Spectra, About, Processing, Export, Versions ---------- */
.stk-extra {
	background: #fff;
	border: 1px solid rgba(210, 215, 217, 0.75);
	border-radius: 12px;
	box-shadow: 0 4px 18px rgba(61, 68, 73, 0.06);
	display: flex;
	flex-direction: column;
	min-height: 220px;
	padding: 1em 1.2em 0.9em;
}
/* its five tabs: the same icon buttons as the settings */
.stk-extra-tabs { grid-template-columns: repeat(7, minmax(2.4em, 1fr)); margin-bottom: 0.7em; }
.stk-extra-head { align-items: baseline; border-bottom: 1px solid #eef0f1; display: flex; flex-wrap: wrap; gap: 0.3em 0.9em; margin-bottom: 0.75em; padding-bottom: 0.55em; }
.stk-extra-head h3 { font-size: 0.95em; margin: 0 auto 0 0; }
.stk-extra-head .stk-example { font-size: 0.75em; padding: 0.3em 0.9em; }
.stk-extra-head .stk-example[disabled] { cursor: default; opacity: 0.45; }
.stk-extra-count { color: #7f888f; font-size: 0.75em; }
.stk-extra-count.is-error { color: #c53d3d; }
.stk-extra-body { flex: 1; min-height: 0; overflow-y: auto; padding-right: 0.4em; scrollbar-color: rgba(127, 136, 143, 0.35) transparent; scrollbar-width: thin; }
.stk-extra-hint { color: #9aa1a6; font-size: 0.72em; line-height: 1.45; margin: 0.6em 0 0; }
.stk-extra-hint.is-error { color: #b54747; }

/* 1. Spectrum list: eye, the line (opens the pop-up), name, group, star */
.stk-specs { display: grid; gap: 0.35em 1em; grid-template-columns: repeat(auto-fill, minmax(19em, 1fr)); list-style: none; margin: 0; padding: 0; }
.stk-spec { align-items: center; background: #fff; border: 1px solid #eef0f1; border-radius: 8px; display: flex; gap: 0.5em; margin: 0; padding: 0.25em 0.45em; position: relative; transition: opacity 0.2s; }
/* the grip: drag to change the order (touch too: the browser must not scroll while dragging it) */
.stk-grip { background: none; border: 0; color: #c5cbd0 !important; cursor: grab; font-size: 0.8em; margin-right: -0.2em; padding: 0.2em 0.1em; touch-action: none; }
.stk-grip:hover, .stk-grip:focus-visible { color: #f56565 !important; outline: none; }
.stk-spec.is-dragging { box-shadow: 0 10px 24px rgba(38, 51, 77, 0.2); cursor: grabbing; opacity: 0.95; transition: none; z-index: 5; }
.stk-spec.is-dragging .stk-grip { cursor: grabbing; }
/* where it would go: a coral bar before or after the nearest row */
.stk-spec.is-drop-before::before, .stk-spec.is-drop-after::after {
	background: #f56565; border-radius: 2px; content: ""; height: 3px; left: 0.4em; position: absolute; right: 0.4em;
}
.stk-spec.is-drop-before::before { top: -0.3em; }
.stk-spec.is-drop-after::after { bottom: -0.3em; }
.stk-spec.is-off { opacity: 0.45; }
.stk-spec input[type="text"] { border-color: transparent; flex: 1; font-size: 0.8em; height: 1.9em; min-width: 0; padding: 0 0.4em; }
.stk-spec input[type="text"]:hover, .stk-spec input[type="text"]:focus { border-color: rgba(210, 215, 217, 0.9); }
.stk-line-btn {
	align-items: center; background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; display: inline-flex;
	flex: 0 0 auto; height: 1.9em !important; justify-content: center; padding: 0 0.25em; transition: border-color 0.2s, background-color 0.2s;
}
.stk-line-btn:hover, .stk-line-btn:focus-visible { background: #f5f6f7; border-color: rgba(210, 215, 217, 0.9); outline: none; }
.stk-line-btn.is-own { border-color: rgba(245, 101, 101, 0.45); }         /* this spectrum has its own line */
.stk-group-in { flex: 0 0 5.6em; }
.stk-spec .stk-group-in { border-color: rgba(210, 215, 217, 0.6); font-size: 0.72em; height: 2em; padding: 0 0.5em; }
.stk-group-bar { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5em 1em; margin-bottom: 0.7em; }
.stk-group-bar .stk-chip2 .icon { color: #f56565; font-size: 0.85em; margin-right: 0.2em; }
.stk-switch-inline { gap: 0.6em; justify-content: flex-start; }
.stk-switch-inline span { font-size: 0.75em; }

/* The line pop-up (opened by clicking a spectrum's line): Colours, Custom, Line */
.stk-pop {
	background: #fff; border: 1px solid rgba(210, 215, 217, 0.9); border-radius: 12px; box-shadow: 0 16px 40px rgba(38, 51, 77, 0.22);
	color: #3d4449; padding: 0.7em 0.8em 0.75em; position: absolute; width: 17.5em; z-index: 60;
	animation: stk-pop-in var(--stk-fade, 0.3s ease) both;
}
@keyframes stk-pop-in { from { opacity: 0; transform: translateY(-4px); } }
.stk-pop button { box-shadow: none; font-family: "Open Sans", sans-serif; height: auto; letter-spacing: 0; line-height: 1.4; text-transform: none; }
.stk-pop-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 0.5em; }
.stk-pop-head strong { font-family: "Roboto Slab", serif; font-size: 0.85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-pop-close { background: none; border: 0; color: #9aa1a6 !important; cursor: pointer; font-size: 1.1em; padding: 0 0.2em; }
.stk-pop-close:hover { color: #f56565 !important; }
.stk-pop-tabs { margin-bottom: 0.65em; }
.stk-pop-label { align-items: baseline; color: #7f888f; display: flex; font-size: 0.68em; font-weight: 700; gap: 0.4em; letter-spacing: 0.04em; margin: 0.55em 0 0.3em; }
.stk-pop-label output { color: #3d4449; font-weight: 600; letter-spacing: 0; }
.stk-pop-hint { color: #9aa1a6; font-size: 0.68em; line-height: 1.4; margin: 0.6em 0 0; }
.stk-theme { display: grid; gap: 3px; grid-template-columns: repeat(10, 1fr); }
.stk-sw {
	aspect-ratio: 1; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 3px; cursor: pointer; display: block; padding: 0 !important;
	transition: transform 0.12s, box-shadow 0.12s; width: 100%;
}
.stk-sw:hover, .stk-sw:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #f56565; outline: none; position: relative; transform: scale(1.18); z-index: 1; }
.stk-sw.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #3d4449; }
.stk-auto {
	align-items: center; background: #f5f6f7; border: 1px solid rgba(210, 215, 217, 0.75); border-radius: 6px; color: #3d4449 !important;
	cursor: pointer; display: flex; font-size: 0.74em; font-weight: 600; gap: 0.6em; padding: 0.35em 0.6em; width: 100%;
}
.stk-auto i { border-radius: 2px; display: block; height: 0.9em; width: 1.6em; }
.stk-auto.is-on, .stk-auto:hover { border-color: #f56565; }
.stk-custom { align-items: center; display: flex; gap: 0.5em; }
.stk-custom input[type="color"] { background: none; border: 1px solid rgba(210, 215, 217, 0.9); border-radius: 6px; cursor: pointer; flex: 0 0 3.2em; height: 2.3em; padding: 2px; }
.stk-custom input[type="text"] { flex: 1; font-family: monospace; font-size: 0.85em; height: 2.3em; }
.stk-custom input.is-bad { border-color: #f56565; }
.stk-pop .stk-seg button { align-items: center; display: inline-flex; justify-content: center; padding: 0.35em 0.2em; }
.stk-pop .stk-row { margin: 0; }
.stk-pop .stk-link { font-size: 0.72em; margin-top: 0.6em; }
.stk-eye, .stk-star { background: none; border: 0; color: #9aa1a6 !important; cursor: pointer; font-size: 0.8em; padding: 0.2em; }
.stk-eye:hover, .stk-star:hover { color: #f56565 !important; }
.stk-star[aria-pressed="true"] { color: #f5a623 !important; }

/* 2. About the data */
.stk-tiles { display: grid; gap: 0.5em; grid-template-columns: repeat(auto-fill, minmax(8.5em, 1fr)); margin-bottom: 0.9em; }
.stk-tile { background: #fafbfb; border: 1px solid #eef0f1; border-radius: 8px; display: flex; flex-direction: column; padding: 0.5em 0.7em; }
.stk-tile small { color: #9aa1a6; font-size: 0.68em; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.stk-tile strong { color: #3d4449; font-size: 0.85em; overflow-wrap: anywhere; }
.stk-about-notes { color: #5f676d; font-size: 0.78em; line-height: 1.5; margin: 0; padding-left: 1.1em; }
.stk-about-file { max-width: 22em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-about-cols { display: grid; gap: 0.6em 1.6em; grid-template-columns: 1fr 1fr; }
.stk-about-list { display: grid; gap: 0.25em 0.9em; grid-template-columns: auto 1fr; margin: 0; }
.stk-about-list dt { color: #9aa1a6; font-size: 0.76em; }
.stk-about-list dd { color: #3d4449; font-size: 0.78em; margin: 0; overflow-wrap: anywhere; }
.stk-about-more { margin-top: 0.7em; }
.stk-about-more summary { color: #f56565; cursor: pointer; font-size: 0.75em; font-weight: 600; margin-bottom: 0.45em; }
.stk-about-more .stk-about-list dt { max-width: 16em; overflow-wrap: anywhere; }
.stk-about-done { margin-top: 1em; }
@media screen and (max-width: 736px) { .stk-about-cols { grid-template-columns: 1fr; } }
/* 4. Fit */
.stk-fit { display: grid; flex: 1; gap: 0.9em; grid-template-columns: 16em minmax(0, 1fr); height: 100%; min-height: 0; }
.stk-fit-bands { border-right: 1px solid #eef0f1; display: flex; flex-direction: column; gap: 0.45em; min-height: 0; overflow-y: auto; padding-right: 0.6em; scrollbar-width: thin; }
.stk-fit-findrow { align-items: center; display: flex; flex-wrap: wrap; gap: 0.35em; }
.stk-fit-addrow { align-items: center; display: flex; gap: 0.35em; }
.stk-fit-find { flex: none; font-size: 0.72em; font-weight: 600; padding: 0.35em 0.75em; white-space: nowrap; }
.stk-fit-snr { font-size: 0.72em !important; height: 2em !important; padding: 0 0.35em !important; width: 3.2em !important; }
.stk-fit-times { color: #9aa1a6; font-size: 0.66em; white-space: nowrap; }
.stk-fit-how { margin-left: auto; }
.stk-fit-how button, .stk-fit-bg button { font-size: 0.66em; padding: 0.25em 0.55em; white-space: nowrap; }
.stk-fit-add { flex: 1; font-size: 0.74em !important; height: 2.1em !important; min-width: 0; padding: 0 0.6em !important; }
.stk-fit-plus { height: 2.1em; justify-content: center; padding: 0; width: 2.1em; }
.stk-fit-list { counter-reset: none; list-style: none; margin: 0; padding: 0; }
.stk-fit-list li { align-items: center; border: 1px solid #eef0f1; border-radius: 8px; display: grid; gap: 0.3em; grid-template-columns: 1.1em 5.2em minmax(0, 1fr) 1.7em 1.3em; margin: 0 0 0.25em; padding: 0.2em 0.35em; }
.stk-fit-list li small { color: #9aa1a6; font-size: 0.66em; text-align: center; }
.stk-fit-list input, .stk-fit-list select, .stk-fit-range input, .stk-fit-shape-all { font-size: 0.72em !important; height: 1.95em !important; min-width: 0; padding: 0 0.4em !important; }
.stk-fit-list select, .stk-fit-shape-all { background-position: right 0.4em center !important; padding-right: 1.7em !important; }
.stk-fit-lock, .stk-fit-remove { background: none; border: 0; box-shadow: none; color: #b4babe !important; cursor: pointer; font-size: 0.72em; height: auto; line-height: 1; padding: 0.2em; }
.stk-fit-lock.is-on { color: #f56565 !important; }
.stk-fit-lock:hover, .stk-fit-remove:hover { color: #f56565 !important; }
.stk-fit-remove { font-size: 1em; }
.stk-fit-row { align-items: center; display: grid; gap: 0.5em; grid-template-columns: 5.6em minmax(0, 1fr); }
.stk-fit-row small { color: #7f888f; font-size: 0.7em; font-weight: 600; }
.stk-fit-row > small { align-items: center; display: inline-flex; line-height: 1.25; }
.stk-fit-row small .stk-info { margin-left: 0.3em; }
.stk-fit-range { align-items: center; display: flex; gap: 0.3em; }
.stk-fit-range span { color: #9aa1a6; font-size: 0.75em; }
.stk-fit-results { display: flex; flex-direction: column; gap: 0.5em; min-width: 0; overflow-y: auto; padding-right: 0.4em; scrollbar-width: thin; }
.stk-fit-quality { display: flex; flex-wrap: wrap; gap: 0.3em 1em; font-size: 0.74em; transition: opacity 0.2s; }
.stk-fit-quality > span { color: #3d4449; font-weight: 600; }
.stk-fit-quality .is-good { color: #2f855a; }
.stk-fit-quality .is-warn { color: #b7791f; }
.stk-fit-quality.is-busy, .stk-fit-table.is-busy { opacity: 0.45; }
.stk-fit-tablebox { overflow-x: auto; }
.stk-fit-table { border-collapse: collapse; font-size: 0.72em; margin: 0; transition: opacity 0.2s; width: 100%; }
.stk-fit-table th { border-bottom: 1px solid #e3e6e8; color: #9aa1a6; font-size: 0.9em; font-weight: 700; padding: 0.25em 0.5em; text-align: left; white-space: nowrap; }
.stk-fit-table td { border-bottom: 1px solid #f2f4f5; color: #3d4449; font-variant-numeric: tabular-nums; line-height: 1.25; padding: 0.3em 0.45em; vertical-align: top; white-space: nowrap; }
.stk-fit-table td small { color: #9aa1a6; display: block; font-size: 0.85em; }
.stk-fit-table tbody tr:nth-child(even) td { background: #fbfbfc; }
.stk-fit-flag { color: #dd6b20; width: 1.2em; }
.stk-fit-notes { font-size: 0.72em; }
.stk-fit-all { font-size: 0.72em; white-space: nowrap; }
.stk-fit-all[disabled] { cursor: default; opacity: 0.4; text-decoration: none; }
.stk-fit-all-title { margin: 0.6em 0 0.1em; }
@media screen and (max-width: 736px) { .stk-fit { grid-template-columns: 1fr; height: auto; } .stk-fit-bands { border-right: 0; padding-right: 0; } }

/* Analysis tab: Fit · PCA · Clusters · MCR as a slim column of icon tabs on the left of the card's body (as the main
   tabs, stacked), so the open analysis keeps the whole width; PCA, Clusters, MCR in the Fit tab's two columns */
.stk-an-body { display: grid; gap: 0.8em; grid-template-columns: 3.5em minmax(0, 1fr); }
.stk-an-body > .stk-an-rail { align-content: start; border-bottom: 0; border-right: 1px solid #eef0f1; display: flex; flex-direction: column;
	gap: 0.2em; margin: 0; overflow: visible; padding: 0 0.5em 0 0; position: sticky; top: 0; }
.stk-an-rail button { padding: 0.45em 0.1em; }
.stk-an-rail button small { font-size: 0.56em; }
.stk-chemo-views button { font-size: 0.68em; padding: 0.25em 0.7em; white-space: nowrap; }
.stk-chemo-views { flex-wrap: wrap; }
.stk-chemo { grid-template-columns: 17em minmax(0, 1fr); }
.stk-chemo-set { gap: 0.55em; }
.stk-chemo-row { align-items: center; display: flex; flex-wrap: wrap; gap: 0.3em 0.45em; }
.stk-chemo-row > small { color: #6b7378; flex: 0 0 auto; font-size: 0.68em; font-weight: 600; min-width: 6.2em; }
.stk-chemo-row .stk-seg { flex: 1 1 auto; min-width: 0; }
.stk-chemo-row .stk-seg button { font-size: 0.66em; padding: 0.25em 0.45em; white-space: nowrap; }
.stk-chemo-row select { font-size: 0.72em !important; height: 2em !important; padding: 0 0.4em !important; width: auto !important; }
.stk-chemo-num { font-size: 0.72em !important; height: 2em !important; padding: 0 0.35em !important; width: 3.6em !important; }
.stk-chemo-switch span { color: #6b7378; font-size: 0.68em; }
.stk-chemo-extra { margin-top: 0.3em; }
.stk-chemo-results.is-busy { opacity: 0.55; }
.stk-chemo-head { color: #3d4449; font-size: 0.76em; font-weight: 600; line-height: 1.45; margin: 0; }
.stk-chemo-line { color: #3d4449; font-size: 0.72em; line-height: 1.45; margin: 0; }
.stk-chemo-note .icon { color: #b7791f; }
.stk-chemo-bars { display: flex; flex-direction: column; gap: 0.25em; }
.stk-chemo-bar { align-items: center; display: grid; gap: 0.5em; grid-template-columns: 2.6em minmax(0, 1fr) 4.2em; }
.stk-chemo-bar small { color: #6b7378; font-size: 0.66em; }
.stk-chemo-bar span { background: #e3e6e8; border-radius: 3px; display: block; height: 0.55em; }
.stk-chemo-bar.is-kept span { background: #f56565; }
.stk-pop-row { display: flex; gap: 0.4em; margin-top: 0.6em; }
@media screen and (max-width: 736px) {
	.stk-chemo { grid-template-columns: 1fr; }
	.stk-an-body { grid-template-columns: 1fr; }
	.stk-an-body > .stk-an-rail { border-bottom: 1px solid #eef0f1; border-right: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 0 0.45em; position: static; }
}
.stk-chemo-more { align-self: flex-start; font-size: 0.68em !important; margin-top: 0.2em; }
.stk-chemo-sub { border-top: 1px solid #eef0f1; color: #3d4449; font-size: 0.66em; letter-spacing: 0.06em; margin: 0.4em 0 0; padding-top: 0.6em; text-transform: uppercase; }
.stk-chemo-textrow { align-items: flex-start; }
.stk-chemo-text { flex: 1 1 8em; font-size: 0.72em !important; min-width: 0; padding: 0.3em 0.45em !important; }
input.stk-chemo-text { height: 2em !important; }
textarea.stk-chemo-text { font-family: inherit; line-height: 1.35; resize: vertical; }
.stk-chemo-unit { color: #9aa1a6 !important; font-weight: 400 !important; min-width: 0 !important; }

/* 5. Identify */
.stk-id { display: grid; flex: 1; gap: 0.9em; grid-template-columns: 13.5em minmax(0, 1fr); height: 100%; min-height: 0; }
.stk-id-filters { border-right: 1px solid #eef0f1; display: flex; flex-direction: column; gap: 0.5em; padding-right: 0.6em; }
.stk-id-filters .stk-fit-row { grid-template-columns: 4.6em minmax(0, 1fr); }
.stk-id-laser button { font-size: 0.64em; padding: 0.25em 0.4em; }
.stk-id-el { font-size: 0.72em !important; height: 1.95em !important; padding: 0 0.5em !important; }
.stk-id-results { display: flex; flex-direction: column; gap: 0.45em; min-width: 0; overflow-y: auto; padding-right: 0.4em; scrollbar-width: thin; }
.stk-id-banner { align-items: center; border-radius: 10px; display: flex; gap: 0.6em; padding: 0.45em 0.7em; transition: opacity 0.2s; }
.stk-id-banner .icon { font-size: 1.05em; }
.stk-id-banner strong { display: block; font-size: 0.78em; }
.stk-id-banner small { color: #5f676d; display: block; font-size: 0.68em; line-height: 1.35; }
.stk-id-banner.is-strong { background: rgba(47, 133, 90, 0.09); color: #2f855a; }
.stk-id-banner.is-likely { background: rgba(183, 121, 31, 0.1); color: #b7791f; }
.stk-id-banner.is-uncertain { background: #f2f4f5; color: #5f676d; }
.stk-id-banner.is-busy, .stk-id-list.is-busy { opacity: 0.45; }
.stk-id-list { list-style: none; margin: 0; padding: 0; transition: opacity 0.2s; }
.stk-id-list li { align-items: center; border: 1px solid #eef0f1; border-radius: 8px; display: grid; gap: 0.5em; grid-template-columns: 1.2em minmax(0, 1fr) 7.5em 1.6em 1.4em; margin: 0 0 0.3em; padding: 0.3em 0.5em; transition: border-color 0.15s, background-color 0.15s; }
.stk-id-list li:hover { background: #fafbfb; border-color: #e3e6e8; }
.stk-id-list li.is-drawn { border-color: rgba(245, 101, 101, 0.4); }
.stk-id-rank { color: #9aa1a6; font-size: 0.7em; font-weight: 700; text-align: center; }
.stk-id-main { min-width: 0; }
.stk-id-name { align-items: baseline; display: flex; gap: 0.45em; min-width: 0; }
.stk-id-name strong { color: #3d4449; font-size: 0.78em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-id-name small { color: #7f888f; font-size: 0.66em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-id-meta { color: #9aa1a6; display: block; font-size: 0.64em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-id-score { align-items: center; display: flex; gap: 0.4em; }
.stk-id-bar { background: #eef0f1; border-radius: 999px; flex: 1; height: 0.35em; overflow: hidden; }
.stk-id-bar span { background: #f56565; border-radius: 999px; display: block; height: 100%; }
.stk-id-score b { color: #3d4449; font-size: 0.72em; font-variant-numeric: tabular-nums; min-width: 2.4em; text-align: right; }
.stk-id-eye { background: none; border: 0; box-shadow: none; color: #b4babe !important; cursor: pointer; font-size: 0.74em; height: auto; line-height: 1; padding: 0.2em; }
.stk-id-eye.is-on, .stk-id-eye:hover { color: #f56565 !important; }
.stk-id-link { border: 0; color: #b4babe !important; font-size: 0.68em; text-align: center; }
.stk-id-link:hover { color: #f56565 !important; }
.stk-id-explorer { font-size: 0.72em; margin-left: auto; white-space: nowrap; }
@media screen and (max-width: 736px) { .stk-id { grid-template-columns: 1fr; height: auto; } .stk-id-filters { border-right: 0; padding-right: 0; } .stk-id-list li { grid-template-columns: 1.2em minmax(0, 1fr) 5.5em 1.6em 1.4em; } }

/* For your paper (bottom of About) */
.stk-forpaper { border-top: 1px solid #eef0f1; margin-top: 1.1em; padding-top: 0.9em; }
.stk-forpaper-head { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5em 0.9em; margin-bottom: 0.7em; }
.stk-forpaper-head .stk-group-title { margin: 0 auto 0 0; }
.stk-forpaper-head .stk-group-title, .stk-bands-ratios > .stk-group-title { align-items: center; display: flex; line-height: 1.25; }
.stk-forpaper-head .stk-group-title .stk-info, .stk-bands-ratios > .stk-group-title .stk-info { margin-left: 0.45em; text-transform: none; }
.stk-forpaper-cite button { font-size: 0.72em; padding: 0.25em 0.9em; white-space: nowrap; }
.stk-forpaper-block { margin-bottom: 0.85em; transition: opacity 0.2s; }
.stk-forpaper-block.is-busy { opacity: 0.45; }
.stk-forpaper-label { align-items: baseline; display: flex; justify-content: space-between; margin-bottom: 0.3em; }
.stk-forpaper-label span { color: #7f888f; font-size: 0.72em; font-weight: 700; }
.stk-forpaper-label .stk-link { font-size: 0.72em; }
.stk-forpaper-text { background: #fafbfb; border: 1px solid #eef0f1; border-radius: 8px; color: #3d4449; font-size: 0.8em; line-height: 1.6; margin: 0; padding: 0.6em 0.8em; user-select: text; }
.stk-forpaper-refs { list-style: none; }
.stk-forpaper-refs li { padding-left: 1.4em; text-indent: -1.4em; }
.stk-forpaper-refs li + li { margin-top: 0.35em; }

/* 3. Processing */
.stk-steps { counter-reset: none; list-style: none; margin: 0; padding: 0; }
.stk-step { align-items: center; border: 1px solid #eef0f1; border-radius: 8px; display: grid; gap: 0.7em; grid-template-columns: 1.6em minmax(9em, 1fr) minmax(0, 1.2fr); margin: 0 0 0.4em; padding: 0.4em 0.6em; transition: border-color 0.2s, background-color 0.2s; }
.stk-step.is-on { background: rgba(245, 101, 101, 0.04); border-color: rgba(245, 101, 101, 0.35); }
.stk-step-no { align-items: center; background: #f5f6f7; border-radius: 50%; color: #7f888f; display: inline-flex; font-size: 0.7em; font-weight: 700; height: 1.9em; justify-content: center; width: 1.9em; }
.stk-step.is-on .stk-step-no { background: #f56565; color: #fff; }
.stk-step select, .stk-step input[type="number"] { font-size: 0.8em; height: 2.2em; }
.stk-step select[disabled], .stk-step input[disabled] { opacity: 0.45; }

/* Chips (Processing's methods) */
.stk-chip2 {
	background: #f5f6f7; border: 1px solid rgba(210, 215, 217, 0.75); border-radius: 999px; color: #3d4449 !important; cursor: pointer;
	font-size: 0.74em; font-weight: 600; padding: 0.3em 0.8em;
}
.stk-chip2:hover { border-color: #f56565; color: #f56565 !important; }
.stk-chip2[aria-pressed="true"] { background: #f56565; border-color: #f56565; color: #fff !important; }

/* 4. Versions */
.stk-versions { display: grid; gap: 0.6em; grid-template-columns: repeat(auto-fill, minmax(9.5em, 1fr)); }
.stk-version {
	background: #fff; border: 1px solid #eef0f1; border-radius: 8px; color: #5f676d !important; cursor: pointer; display: flex; flex-direction: column;
	gap: 0.3em; padding: 0.35em; transition: border-color 0.2s, box-shadow 0.2s;
}
.stk-version img { border-radius: 4px; display: block; height: auto; width: 100%; }
.stk-version small { font-size: 0.66em; }
.stk-version:hover { border-color: #f56565; }
.stk-version.is-current { border-color: #f56565; box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.18); }

/* ---------- Narrower screens: settings under the figure; phones: one column ---------- */
@media screen and (max-width: 1100px) {
	.stk-app { grid-template-areas: "data" "figure" "settings"; grid-template-columns: minmax(0, 1fr); }
	.stk-extra { height: auto !important; max-height: 70vh; }
	.stk-settings { height: auto !important; }
}
@media screen and (max-width: 736px) {
	.stk-app { gap: 1em; }
	.stk-data, .stk-settings { padding: 0.9em; }
	.stk-figure-card { padding: 1em 0.9em 0.9em; }
	.stk-paper { min-height: 180px; padding: 0.5em; }
	.stk-drop-formats { padding-left: 0; }
	.stk-figure-foot { flex-direction: column; align-items: stretch; }
	.stk-export { justify-content: space-between; }
	.stk-export select { flex: 1; }
	.stk-download { flex: 1 1 100%; padding: 0.7em; }
}
@media (prefers-reduced-motion: reduce) {
	.stk-status.is-busy i { animation: none; }
	.stk-pop { animation: none; }
	.stk-paper, .stk-paper img, .stk-settings, .stk-seg button, .stk-switch input, .stk-switch input::after { transition: none; }
}

/* ---- Processing (card under the figure): the steps as a list, the chosen one on the right -------------- */
.stk-extra-processing .stk-extra-head { align-items: center; }
.stk-extra-processing .stk-extra-body { display: flex; flex-direction: column; overflow: hidden; padding-right: 0; }
.stk-pr-title { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; margin-right: 0.3em; min-width: 0; }
.stk-pr-title h3 { line-height: 1.15; margin: 0 !important; }
.stk-pr-note { flex: none; font-size: 0.68em; max-width: 7.5em; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.stk-pr-apply { align-items: center; display: inline-flex; gap: 0.45em; margin-left: -0.2em; }
.stk-pr-apply small { color: #9aa1a6; font-size: 0.7em; white-space: nowrap; }
.stk-pr-apply .stk-switch { gap: 0.35em; }
.stk-pr-apply .stk-switch span { margin-right: 0.1em; white-space: nowrap; }
.stk-pr-target { background-position: right 0.55em center !important; font-size: 0.72em !important; height: 2em !important; max-width: 11em; padding: 0 2.3em 0 0.6em !important; text-overflow: ellipsis; width: auto; }
.stk-pr-target[disabled] { opacity: 0.45; }
.stk-pr-reset { margin-left: auto; margin-right: 0.3em; }
.stk-pr-act { align-items: center; background: #fff; border: 1px solid #e3e6e8; border-radius: 999px; box-shadow: none; color: #3d4449 !important; cursor: pointer; display: inline-flex;
	font: 600 0.72em "Open Sans", sans-serif; gap: 0.35em; height: auto; letter-spacing: 0; line-height: 1; padding: 0.45em 0.6em; text-transform: none; }
.stk-pr-act:hover { border-color: #f56565; color: #f56565 !important; }
.stk-pr-act[disabled] { cursor: default; opacity: 0.4; }
.stk-pr-act[disabled]:hover { border-color: #e3e6e8; color: #3d4449 !important; }
.stk-pr-data { background: #f56565; border-color: #f56565; color: #fff !important; padding: 0.45em 0.8em; }
.stk-pr-data:hover, .stk-pr-data[disabled]:hover { background: #f56565; border-color: #f56565; color: #fff !important; }
.stk-pr { display: grid; flex: 1; gap: 0.9em; grid-template-columns: 9.5em minmax(0, 1fr); height: 100%; min-height: 0; }
.stk-pr-list { border-right: 1px solid #eef0f1; list-style: none; margin: 0; overflow-y: auto; padding: 0 0.5em 0 0; scrollbar-width: thin; }
.stk-pr-list li { align-items: center; border-radius: 8px; cursor: pointer; display: flex; gap: 0.5em; margin: 0 0 1px; padding: 0.1em 0.4em; }
.stk-pr-list li:hover { background: #fafbfb; }
.stk-pr-list li.is-picked { background: rgba(245, 101, 101, 0.09); }
.stk-pr-list li strong { color: #3d4449; display: block; font-size: 0.76em; line-height: 1.2; }
.stk-pr-list .stk-switch { margin: 0 -0.5em 0 0; transform: scale(0.72); transform-origin: left center; }
.stk-pr-detail { display: flex; flex-direction: column; gap: 0.35em; min-width: 0; overflow-y: auto; padding-right: 0.4em; scrollbar-width: thin; }
.stk-pr-detail.is-off .stk-pr-chips, .stk-pr-detail.is-off .stk-pr-sets { opacity: 0.65; pointer-events: none; }
.stk-pr-head { align-items: center; display: flex; gap: 0.5em; }
.stk-pr-head h4 { font-size: 0.85em; margin: 0 auto 0 0; }
.stk-pr-head .icon { color: #f56565; font-size: 0.85em; }
.stk-pr-locked { color: #9aa1a6; font-size: 0.7em; }
.stk-pr-about { color: #7f888f; font-size: 0.72em; line-height: 1.4; margin: 0; }
.stk-pr-chips { display: flex; flex-wrap: wrap; gap: 0.3em; }
.stk-pr-chips .stk-chip2 { font-size: 0.7em; padding: 0.3em 0.75em; }
.stk-pr-sets { display: flex; flex-direction: column; gap: 0.3em; margin-top: 0.45em; }
.stk-pr-cols { align-items: start; column-gap: 1em; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stk-pr-col { display: flex; flex-direction: column; gap: 0.3em; min-width: 0; }
.stk-pr-set { align-items: start; display: grid; gap: 0.5em; grid-template-columns: minmax(0, 1fr) 5.2em; }
.stk-pr-set.stk-pr-wide { grid-template-columns: 9em minmax(0, 1fr); }
.stk-pr-name { color: #5f676d; font-size: 0.72em; }
.stk-pr-name b { color: #5f676d; display: inline; font-size: 1em; font-weight: 600; }
.stk-pr-name small { color: #a3a9ad; display: block; font-size: 0.86em; line-height: 1.15; }
.stk-pr-set input[type=number], .stk-pr-set input[type=text], .stk-pr-set select, .stk-pr-set .stk-pair input { font-size: 0.75em; height: 1.95em; min-width: 0; padding: 0 0.6em; }
.stk-pr-set input[type=number] { width: 100%; }
.stk-pr-seg { display: inline-flex; justify-self: start; width: auto; }
.stk-pr-seg button { font-size: 0.7em; padding: 0.3em 0.8em; white-space: nowrap; }
/* Processing: Subtract (a reference spectrum removed; manual factor or every reference fitted together) */
.stk-sub > * { flex-shrink: 0; }                         /* a scroll box: nothing squeezed (the table kept its height) */
.stk-sub-mode { align-self: flex-start; }
.stk-sub-mode button { font-size: 0.7em; padding: 0.3em 0.9em; white-space: nowrap; }
.stk-sub .stk-pr-set { grid-template-columns: minmax(0, 1fr) 7.6em; }          /* room for "Each spectrum" */
.stk-sub .stk-pr-set.stk-pr-wide { align-items: center; grid-template-columns: 9em minmax(0, 1fr); }
.stk-sub .stk-pr-act { font-size: 0.72em; }
.stk-sub-search { display: flex; gap: 0.35em; min-width: 0; }
.stk-sub-search input { flex: 1; font-size: 0.75em; height: 1.95em; min-width: 0; padding: 0 0.6em; }
.stk-sub-found { border: 1px solid #eef0f1; border-radius: 8px; list-style: none; margin: 0; max-height: 9.5em; overflow-y: auto; padding: 0.2em; scrollbar-width: thin; }
.stk-sub-found button { background: none; border: 0; border-radius: 6px; box-shadow: none; color: #3d4449 !important; cursor: pointer; display: block; font-size: 0.74em;
	height: auto; line-height: 1.35; overflow: hidden; padding: 0.3em 0.5em; text-align: left; text-overflow: ellipsis; text-transform: none; white-space: nowrap; width: 100%; }
.stk-sub-found button:hover { background: rgba(245, 101, 101, 0.07); }
.stk-sub-found small { color: #9aa1a6; font-weight: 400; }
.stk-sub-chips { display: flex; flex-wrap: wrap; gap: 0.3em; }
.stk-sub-chip { align-items: center; background: #f5f6f7; border-radius: 999px; color: #3d4449; display: inline-flex; font-size: 0.72em; gap: 0.35em; line-height: 1.3;
	max-width: 100%; overflow: hidden; padding: 0.2em 0.7em; text-overflow: ellipsis; white-space: nowrap; }
.stk-sub-table .stk-sub-chip { font-size: 1em; padding: 0.1em 0.6em; }
.stk-sub-chip.is-approx { background: #fff6e5; }
.stk-sub-chip button { background: none; border: 0; box-shadow: none; color: #9aa1a6 !important; cursor: pointer; font-size: 1.1em; height: auto; line-height: 1; padding: 0 0 0 0.1em; }
.stk-sub-chip button:hover { color: #c53d3d !important; }
.stk-sub-table .stk-switch { transform: scale(0.72); transform-origin: left center; }
.stk-sub-quality { margin: 0.2em 0 0; }
.stk-sub-warn { color: #b7791f; }
/* Versions: the data versions */
.stk-pr-vlist { list-style: none; margin: 0 0 0.3em; padding: 0; }
.stk-pr-v { align-items: flex-start; border: 1px solid #eef0f1; border-radius: 8px; cursor: pointer; display: flex; gap: 0.6em; margin-bottom: 0.35em; padding: 0.45em 0.6em; }
.stk-pr-v:hover { border-color: #f9b3b3; }
.stk-pr-v.is-on { background: rgba(245, 101, 101, 0.06); border-color: #f56565; }
.stk-pr-v-dot { border: 2px solid #d6dadd; border-radius: 50%; flex: none; height: 0.8em; margin-top: 0.25em; width: 0.8em; }
.stk-pr-v.is-on .stk-pr-v-dot { background: #f56565; border-color: #f56565; }
.stk-pr-v-main { flex: 1; min-width: 0; }
.stk-pr-v-main strong { color: #3d4449; font-size: 0.8em; margin-right: 0.5em; }
.stk-pr-v-time, .stk-pr-v-sub { color: #9aa1a6; font-size: 0.7em; }
.stk-pr-v-sub { display: block; }
.stk-pr-v-steps summary { color: #f56565; cursor: pointer; font-size: 0.7em; font-weight: 600; }
.stk-pr-v-steps ol { color: #5f676d; font-size: 0.7em; margin: 0.3em 0 0; padding-left: 1.3em; }
.stk-pr-del { background: none; border: 0; box-shadow: none; color: #b4babe !important; cursor: pointer; font-size: 0.75em; height: auto; line-height: 1; padding: 0.2em; }
.stk-pr-del:hover { color: #c53d3d !important; }
/* Phones: the step list above the chosen step (in a row that wraps), the settings in one column */
@media screen and (max-width: 736px) {
	.stk-pr { grid-template-columns: minmax(0, 1fr); height: auto; }
	.stk-pr-list { border-bottom: 1px solid #eef0f1; border-right: 0; display: flex; flex-wrap: wrap; gap: 2px 0.4em; overflow: visible; padding: 0 0 0.4em; }
	.stk-pr-cols { grid-template-columns: minmax(0, 1fr); }
	.stk-pr-col + .stk-pr-col { margin-top: 0.3em; }
	.stk-pr-set.stk-pr-wide { grid-template-columns: 6.5em minmax(0, 1fr); }
	.stk-extra-processing .stk-extra-body { overflow: visible; }
	.stk-extra.stk-extra-processing { max-height: none; }      /* the page scrolls: a long step (Subtract) stays inside its card */
	.stk-sub .stk-pr-set { grid-template-columns: minmax(0, 1fr) 10.5em; }   /* phones' larger select text */
	.stk-pr-detail { overflow: visible; }
}
/* The Data menu (Processing's "Data" button) */
.stk-data-pop { width: 16.5em; }
.stk-data-row { align-items: center; display: flex; gap: 0.6em; margin-bottom: 0.6em; }
.stk-data-row small { color: #9aa1a6; font-size: 0.72em; }
.stk-data-row select { flex: 1; font-size: 0.75em; height: 2.1em; padding: 0 2em 0 0.6em; }
.stk-data-formats { display: grid; gap: 0.35em; grid-template-columns: repeat(3, 1fr); }
.stk-data-format { align-items: center; background: #fafbfb !important; border: 1px solid #e3e6e8 !important; border-radius: 8px; color: #3d4449 !important; cursor: pointer;
	display: flex; flex-direction: column; gap: 0.1em; padding: 0.45em 0.2em !important; }
.stk-data-format:hover { border-color: #f56565 !important; }
.stk-data-format[disabled] { cursor: progress; opacity: 0.5; }
.stk-data-format strong { font-size: 0.8em; }
.stk-data-format small { color: #9aa1a6; font-size: 0.62em; }
.stk-data-pop .stk-pop-hint.is-error { color: #c53d3d; }
/* The Recipe menu (Processing's book button) */
.stk-recipe-pop { width: 18em; }
.stk-recipe-actions { display: grid; gap: 0.35em; grid-template-columns: 1fr 1fr; }
.stk-recipe-title { margin: 0.8em 0 0.35em; }
.stk-recipe-list { list-style: none; margin: 0 0 0.45em; max-height: 9em; overflow-y: auto; padding: 0; }
.stk-recipe-list li { align-items: center; display: flex; gap: 0.3em; margin-bottom: 2px; }
.stk-recipe-use { align-items: baseline; background: none !important; border: 0; border-radius: 6px; color: #3d4449 !important; cursor: pointer; display: flex; flex: 1;
	gap: 0.5em; justify-content: space-between; padding: 0.25em 0.4em !important; text-align: left; }
.stk-recipe-use:hover { background: rgba(245, 101, 101, 0.09) !important; }
.stk-recipe-use strong { font-size: 0.78em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stk-recipe-use small { color: #9aa1a6; flex: none; font-size: 0.66em; }
/* The Before/after menu (Processing's columns button) */
.stk-pr-cmp.is-on { border-color: #f56565; color: #f56565 !important; }
.stk-cmp-pop { width: 15em; }
.stk-cmp-list { max-height: none; }
.stk-cmp-use[aria-pressed=true] { background: rgba(245, 101, 101, 0.09) !important; }
.stk-cmp-use[aria-pressed=true] strong { color: #f56565; }
.stk-recipe-none { color: #9aa1a6; font-size: 0.72em; padding: 0.2em 0.4em; }
.stk-recipe-keep input { font-size: 0.75em; height: 2.1em; }
.stk-recipe-keep .stk-example { flex: 0 0 auto; font-size: 0.72em; padding: 0.3em 0.9em; }
/* Batch, in the Recipe menu */
.stk-batch-row { align-items: center; display: flex; gap: 0.5em; }
.stk-batch-formats { flex: none; gap: 0.15em; }
.stk-batch-formats button { font-size: 0.68em; letter-spacing: 0.02em; padding: 0.35em 0.75em; }
.stk-batch-run { flex: 1; font-size: 0.72em; padding: 0.4em 0.6em; white-space: nowrap; }

/* the small drawing of each spectrum in its row (Spectrum tab) */
.stk-sketch { flex: 0 0 auto; opacity: 0.9; }
.stk-spec.is-off .stk-sketch { opacity: 0.5; }
.stk-spec:hover .stk-sketch { opacity: 1; }

/* Figure > Size: the unit after your own size switches cm / in on a click (same width either way) */
.stk-unit-toggle { align-self: center; background: none !important; border: 0 !important; border-bottom: 1px dashed #b4babe !important; border-radius: 0; box-shadow: none;
	color: #7f888f !important; cursor: pointer; flex: 0 0 1.6em !important; font-size: 0.8em; height: auto !important; line-height: 1.3 !important; padding: 0 !important; text-align: center; }
.stk-unit-toggle:hover { border-bottom-color: #f56565 !important; color: #f56565 !important; }
/* a colour with its opacity: the swatch over a checkerboard, its picker in a pop-up */
.stk-swatch { background: none !important; border: 0 !important; border-radius: 4px; box-shadow: none; cursor: pointer; flex: 0 0 auto; height: auto !important; line-height: 0 !important; padding: 0 !important; }
.stk-swatch:hover svg, .stk-swatch:focus-visible svg { filter: drop-shadow(0 0 2px rgba(245, 101, 101, 0.6)); }
.stk-colour-pop .stk-num { flex: 0 0 4.3em; }

/* Annotate > Notes: one note per line */
.stk-c-row textarea { font-size: 0.78em; line-height: 1.4; min-height: 4.2em; padding: 0.4em 0.6em; resize: vertical; width: 100%; }

/* ---------- 6. Bands: ranges (left, as the Fit tab's bands), the measured table and the ratios (right) ---------- */
.stk-bands-left > *, .stk-bands-results > * { flex-shrink: 0; }      /* the columns scroll; their parts keep their height */
.stk-bands-foundbox { max-height: 9.5em; overflow-y: auto; margin: 0.3em 0 0.5em; }
.stk-bands-found td, .stk-bands-found th { padding: 0.15em 0.35em; }
.stk-bands-add { background: none; border: 1px solid rgba(210, 215, 217, 0.9); border-radius: 4px; box-shadow: none; color: #3b4378 !important; cursor: pointer; font-size: 0.7em; height: auto; line-height: 1; padding: 0.25em 0.4em; }
.stk-bands-add.is-taken { color: #b3b8bb !important; }
.stk-bands-add:hover { background: #3b4378; color: #fff !important; }
.stk-bands-addrow input { flex: 1 1 0; min-width: 0; }
.stk-bands-list li { grid-template-columns: 1.1em minmax(3.2em, 1fr) auto minmax(3.2em, 1fr) minmax(3em, 1.1fr) auto auto; }
.stk-bands-dash { color: #9aa0a4; text-align: center; }
.stk-bands-name { font-size: 0.85em; min-width: 0; }
.stk-bands-two, .stk-bands-kind { background: none; border: 0; box-shadow: none; color: #e0a800 !important; cursor: pointer; height: auto; line-height: 1; padding: 0 0.2em; }
.stk-bands-kind { border: 1px solid rgba(210, 215, 217, 0.9); border-radius: 4px; color: #3b4378 !important; font-weight: 700; min-width: 1.6em; padding: 0.2em 0.35em; }
.stk-bands-ratios { margin-top: 0.6em; }
.stk-bands-ratio-list { list-style: none; margin: 0 0 0.4em; padding: 0; }
.stk-bands-ratio-list li { align-items: center; border-bottom: 1px solid rgba(210, 215, 217, 0.5); display: flex; flex-wrap: wrap; gap: 0.35em; font-size: 0.85em; padding: 0.3em 0; }
.stk-bands-ratio-list li.is-off { opacity: 0.55; }
.stk-bands-side { align-items: center; display: inline-flex; flex-wrap: wrap; gap: 0.2em; }
.stk-bands-chip { background: #f1f3f9; border-radius: 999px; font-size: 0.9em; padding: 0.1em 0.5em; white-space: nowrap; }
.stk-bands-chip button { background: none; border: 0; box-shadow: none; color: #7a8085 !important; cursor: pointer; height: auto; line-height: 1; padding: 0 0 0 0.25em; }
.stk-bands-more { font-size: 0.85em; height: 1.9em; padding: 0 0.3em; width: 2.6em; }
.stk-bands-over { color: #7a8085; font-weight: 700; }
.stk-bands-ratio-list .stk-bands-name { flex: 0 1 7em; height: 1.9em; }
.stk-bands-value { flex: 1 1 10em; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.stk-bands-rflag { color: #e0a800; margin-left: 0.35em; }
.stk-bands-newratio { align-items: center; display: flex; flex-wrap: wrap; gap: 0.35em; font-size: 0.85em; }
.stk-bands-newratio select { flex: 1 1 6em; height: 2.1em; min-width: 0; }
.stk-bands-view { margin-left: 0.3em; }
@media screen and (max-width: 736px) {                 /* a range on two lines: from – to ×, then name ⚑ */
	.stk-bands-list li { grid-template-columns: 1.1em 1fr auto 1fr 1.8em; }
	.stk-bands-list .stk-fit-remove { grid-column: 5; grid-row: 1; }
	.stk-bands-list .stk-bands-name { grid-column: 2 / 5; grid-row: 2; }
	.stk-bands-list .stk-bands-two { grid-column: 5; grid-row: 2; }
}
