@font-face {
	font-family: "Inter-Regular";
	src: url("/static/fonts/Inter-Regular.woff2") format("woff2");
	font-style: normal;
}
@font-face {
	font-family: "Inter-Medium";
	src: url("/static/fonts/Inter-Medium.woff2") format("woff2");
	font-style: normal;
}
@font-face {
	font-family: "Inter-SemiBold";
	src: url("/static/fonts/Inter-SemiBold.woff2") format("woff2");
	font-style: normal;
}
@font-face {
	font-family: "RobotoMono";
	src: url("/static/fonts/RobotoMono.woff2") format("woff2");
	font-style: normal;
}

body {
	--font-family-regular: Inter-Regular, sans-serif;
	--font-family-medium: Inter-Medium, sans-serif;
	--font-family-semi-bold: Inter-SemiBold, sans-serif;
	--font-family-mono: RobotoMono, monospace;

	--font-size-h00: 32px;
	--font-size-h0: 28px;
	--font-size-h1: 24px;
	--font-size-h2: 20px;
	--font-size-h3: 18px;
	--font-size-h4: 16px;
	--font-size-h5: 14px;
	--font-size-h6: 12px;

	--font-size-heading: var(--font-size-h4);
	--font-size-md: 14px;
	--font-size-sm: 12px;

	--font-lineHeight-3: 12px;
	--font-lineHeight-4: 16px;
	--font-lineHeight-4a: 18px;
	--font-lineHeight-5: 20px;
	--font-lineHeight-6: 24px;
	--font-lineHeight-7: 28px;
	--font-lineHeight-7a: 30px;
	--font-lineHeight-8: 32px;
	--font-lineHeight-9: 36px;
	--font-lineHeight-10: 38px;
	--font-lineHeight-11: 44px;

	--font-lineHeight-sm: var(--font-lineHeight-3);
	--font-lineHeight-md: var(--font-lineHeight-4);

	--iconHeight-2: 8px;
	--iconHeight-3: 12px;
	--iconHeight-4: 16px;
	--iconHeight-5: 20px;
	--iconHeight-8: 32px;

	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-5: 20px;
	--space-6: 24px;
	--space-7: 28px;
	--space-8: 32px;
	--space-9: 36px;
	--space-10: 40px;
	--space-11: 44px;
	--space-12: 48px;

	--interaction-medium: 28px;
	--interaction-large: 36px;

	--button-size: 28px;
	--button-size-lg: 36px;

	--button-modal-width: 84px;
	--button-modal-height: 36px;

	--select-button-height: var(--button-size);

	--border-radius-xsm: 2px;
	--border-radius-sm: 4px;
	--border-radius-md: 6px;
	--border-radius-lg: 10px;
	--border-radius-xlg: 20px;
	--border-width: 1px;
	--border-color: var(--color-gray-300);
	--border-input: var(--color-gray-500);
	--border-focusColor: var(--color-primary);

	--outline-color: var(--color-primary);
	--invalid-color: var(--color-error);

	--layer-flyout: 1e12;
	--layer-modal: 1e12;
	--layer-d3tooltip: 1e12;

	--color-white-opacity: rgba(255, 255, 255, 0.95);
	--color-white: #ffffff;
	/* One ramp, cool: every step sits at hue 272-285 in Lab, with the tint
	   growing as it darkens. The lightness steps grow with it - 2, 3, 5, 7,
	   10, then the 14-16 of the dark half - so that neighbouring steps are
	   told apart wherever they are used. The five lightest once lived within
	   9 points of white, which made a panel on white all but invisible and
	   left nothing at all around 80, where a mid-grey border belongs.

	   600 and 700 sit closer to each other than the rest: both are text, muted
	   and plain, and 600 has to stay dark enough to read on the light surfaces
	   above it - at its old #7d828f it fell short of 4.5:1 even on white. What
	   opens up between 500 and 600 is the stretch nothing is drawn in: 500 is
	   a placeholder and a border, not a text colour. */
	--color-gray-50: #f7f8fa;
	--color-gray-100: #f0f1f4;
	--color-gray-200: #e5e7ec;
	--color-gray-300: #d7dae1;
	--color-gray-400: #c2c6d0;
	--color-gray-500: #989daa;
	--color-gray-600: #686d7c;
	--color-gray-700: #545b6c;
	--color-gray-800: #333a50;
	--color-gray-900: #1c243c;
	/* gray-600 let through, for a hairline over a drawing rather than a
	   surface. */
	--color-gray-border: rgba(125, 130, 143, 0.85);
	--color-black: #161d30;
	--color-black-opacity: rgba(22, 22, 22, 0.2);
	--color-shadow-opacity: rgba(0, 0, 0, 0.2);
	--color-light-shadow-100: rgba(0, 0, 0, 0.09);
	--color-light-shadow-200: rgba(0, 0, 0, 0.1);
	--color-shadow-soft: rgba(0, 0, 0, 0.12);

	--color-primary-100: #d8d8f4;
	--color-primary-200: #b1b0e8;
	--color-primary-300: #8b89dd;
	--color-primary-400: #6461d1;
	--color-primary: #3d3ac6;
	--color-primary-600: #2a2896;
	--color-primary-700: #252377;

	--color-secondary-100: #e6f5ff;
	--color-secondary-200: #b3e0ff;
	--color-secondary-300: #80ccff;
	--color-secondary-400: #4db8ff;
	--color-secondary: #0099ff;
	--color-secondary-600: #007acc;
	--color-secondary-700: #005c99;
	--color-secondary-800: #003d66;
	--color-secondary-900: #001f33;

	/* Chat accent. The deep half of the ramp is anchored on the prompt
	   gradient, so the gradient and the entry and overview indicators are
	   provably the same family rather than approximately so. */
	--color-chat-25: #fafcff;
	--color-chat-50: #f3f7fc;
	--color-chat-100: #e2ebf9;
	--color-chat-150: #cdddf4;
	--color-chat-200: #b8cfef;
	--color-chat-300: #7ba3db;
	--color-chat-400: #006aff;
	--color-chat: #0055cc;
	--color-chat-600: #004099;
	--color-chat-700: #00337a;
	--color-chat-800: #002b66;
	--color-chat-900: #001533;

	--color-red-50: #c6a6c540;
	--color-red-100: #fcd3db;
	--color-red-200: #f9a8b6;
	--color-red-300: #f57c92;
	--color-red-400: #f2516d;
	--color-red-transparent: rgb(239, 37, 73, 0.6);
	--color-red: #ef2549;
	--color-red-900: #30070f;

	--color-orange-200: #ffe39b;
	--color-orange-300: #ffd568;
	--color-orange-400: #ffc736;
	--color-orange: #ffb904;
	--color-orange-900: #332501;

	--color-green-100: #d3f2e7;
	--color-green-200: #89b7ba40;
	--color-green-300: #7ad8b6;
	--color-green: #22be86;
	--color-green-900: #07261b;

	--color-violet-200: #dfc7ff;
	--color-violet-300: #caa1ff;
	--color-violet: #9543ff;
	--color-violet-900: #1e0d33;

	--color-blue-300: #7fb2ff;
	--color-blue: #297fff;
	--color-blue-light: rgba(0, 120, 255, 0.05);
	--color-blue-500: #91bdcb;
	--color-blue-600: #2166cc;
	--color-blue-900: #081933;

	--color-turquoise-200: #cff4f7;
	--color-turquoise-300: #a0e9ef;
	--color-turquoise: #1ccad8;

	--color-pink: #ff6392;

	--color-success: var(--color-green);
	--color-debug: var(--color-green-300);
	--color-info: var(--color-blue-300);
	--color-warning-400: var(--color-orange-400);
	--color-warning: var(--color-orange);
	--color-error-transparent: var(--color-red-transparent);
	--color-error: var(--color-red);
	--color-change: #9442ff33;
	--color-link: var(--color-blue);
	--color-link-600: var(--color-blue-600);
	--color-new: var(--color-turquoise);

	/* The background of a highlighted table cell, one per Highlight value of
	   table-string.bn.js. */
	--highlight-success: var(--color-success);
	--highlight-warning: var(--color-warning);
	--highlight-error: var(--color-error);
	--highlight-change: var(--color-change);
	--highlight-new: var(--color-new);
	--highlight-light-red: var(--color-red-100);
	--highlight-gray: var(--color-gray-400);
	--highlight-diff: var(--color-green-100);

	--color-new-100: #e8fafb;
	--color-new-200: #cff4f7;
	--color-new-300: #a0e9ef;
	--color-new-400: #70dee7;
	--color-new-600: #16a2ad;
	--color-new-700: #117982;
	--color-new-800: #0b5156;
	--color-new-900: #06282b;

	--color-item: #b3e0ff;
	--color-feature: #c0b3ff;
	--color-sequence: #ffe7b3;
	--color-file: #b3ffdd;
	--color-location: #ffb3b3;
	--color-script: #b3fcff;
	--color-script-default: #cbe6e7;
	--color-spec: #fbb3ff;
	--color-workspace: #e3ffb3;
	--color-item-query: #b3d0ff;
	--color-view-query: #ffd6b3;
	--color-background: linear-gradient(
		135deg,
		#ebf4ff 0%,
		#ffffff 50%,
		#f0f9ff 100%
	);

	--color-top-bar-workspace: #5d77ab13;
	--color-workspace-card: #80c6ca44;
	--color-workspace-warning: #e9edf1a2;
	--color-workspacebutton: #76a9df54;

	--color-workbook: #b3ffdd;
	--color-sheet: #ffe7b3;
	--color-table: #c0b3ff;
	--color-table-col: #f2b3ff;
	--color-table-row: #b3e0ff;

	--color-command: #1b1b1b;
	--color-running: #084cf3;
	--color-pending: #084cf3;
	--color-done: #2b8214;
	--color-failed: #f33508;
	--color-killed: #c8a110;

	--chevron-size: 20px;

	--max-height-modal: calc(100vh - 150px);
	--max-width-modal: calc(100vw - 100px);

	--b-length: 4px;
}

body {
	font-family: var(--font-family-regular);
	font-size: var(--font-size-md);
	color: var(--color-black);
}

/* The app has one light look. Without these, a host that prefers dark
   (the desktop app's browser pane, a dark-mode webview) paints its own dark
   backdrop behind everything transparent, such as the workbook grid, and
   renders form controls and scrollbars dark. */
html {
	color-scheme: light;
	background-color: white;
}

html,
body {
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

/* Body is a column so a full-width banner (the update-available notice) sits
   ABOVE the app and pushes it down rather than overlaying it (which covered the
   workbook toolbar). With no banner, the single #root child just fills the
   height exactly as before. */
body {
	display: flex;
	flex-direction: column;
}

#root {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

h4 {
	font-family: var(--font-family-semi-bold);
	font-size: var(--font-size-h4);
	line-height: var(--font-lineHeight-6);
}

button.icon:hover {
	cursor: pointer;
}

.bn-button {
	margin: 16px auto 0;
	padding: 10px 18px;
	font-size: var(--font-size-md);
	font-family: var(--font-family-medium);
	font-weight: 500;
	border-radius: 999px;
	border: 1px solid var(--color-gray-300);
	background: var(--color-white);
	color: var(--color-gray-800);
	cursor: pointer;
}

.bn-button:not(:disabled):hover {
	color: var(--color-gray-900);
	--hover-fill: var(--color-gray-900);
	border-color: var(--color-gray-600);
	background-color: var(--color-gray-200);
	cursor: pointer;
}
.bn-button.emphasis {
	background-color: var(--color-primary);
	color: var(--color-white);
	border: none;
}
.bn-button.emphasis:hover {
	background-color: var(--color-primary-400);
	color: var(--color-white);
	border: none;
}
.bn-button:disabled {
	cursor: auto;
	opacity: 0.5;
}

/** Span container for icon buttons */
.icon-button-container,
span:has(> button.icon) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	width: 28px;
	border-radius: 50%;
	border: 1px solid var(--color-gray-300);
}
.icon-button-container:has(button:hover),
span:has(> button.icon:hover) {
	cursor: pointer;
	background-color: var(--color-gray-200);
}

input[type="checkbox"] {
	height: 14px;
	width: 14px;
	border: 1px solid var(--color-gray-600);
	border-radius: var(--border-radius-xsm);
}
input[type="checkbox"]:not([disabled]):hover {
	cursor: pointer;
	color: var(--color-gray-200);
}
span:has(> input[type="checkbox"]) {
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	width: 28px;
}
span:has(> input[type="checkbox"]:not([disabled])):hover {
	cursor: pointer;
	background-color: var(--color-gray-200);
}

.hidden {
	display: none;
}

.popover {
	margin: 0;
	padding: 0;
	background-color: var(--color-white);
	border: var(--border-width) solid var(--color-gray-400);
	box-shadow: 2px 2px 10px 2px rgba(0, 0, 0, 0.15);
	min-height: 1rem;
	min-width: 100px;
	overflow: auto;
}

/* Dialogs: prompt, confirm, alert and the template behind the larger
   editors all take their look from here, so they move together. A compact
   dialog asks one thing and is sized for that; the others size to their
   content. */
.modal {
	box-sizing: border-box;
	background-color: var(--color-white);
	border: 0;
	border-radius: var(--border-radius-lg);
	padding: 0;
	box-shadow: 0 12px 36px var(--color-light-shadow-200);
}

.modal::backdrop {
	background: var(--color-black-opacity);
}

.modal .container {
	box-sizing: border-box;
	max-width: calc(100vw - 40px);
	max-height: calc(100vh - 40px);
	width: var(--modal-content-width, max-content);
	min-width: min(20rem, 90vw);
	padding: 20px;
	display: flex;
	flex-direction: column;
	row-gap: 16px;
}

.modal .container.compact {
	max-width: min(30rem, calc(100vw - 40px));
}

.modal .container.input-suggestions {
	min-width: clamp(0px, 40rem, 90vw);
}

.modal .content {
	overflow: var(--modal-content-overflow, auto);
	min-height: clamp(0px, 10rem, 100vh - 40px);
	width: auto;
	height: var(--modal-content-height, auto);
}

.modal .title {
	font-family: var(--font-family-medium);
	font-size: var(--font-size-h4);
	line-height: 22px;
	color: var(--color-gray-900);
}

.modal .description {
	margin-top: 4px;
	font-size: var(--font-size-md);
	line-height: 20px;
	color: var(--color-gray-700);
}

.modal .description:empty {
	display: none;
}

.modal .buttons {
	display: flex;
	justify-content: flex-end;
	align-items: safe center;
	column-gap: 8px;
}

.modal .cancel,
.modal .confirm {
	height: var(--interaction-medium, 32px);
	padding: 0 14px;
	border: var(--border-width) solid transparent;
	border-radius: var(--border-radius-sm);
	font-family: var(--font-family-medium);
	font-size: var(--font-size-md);
	cursor: pointer;
}

.modal .cancel {
	color: var(--color-gray-700);
	background-color: var(--color-white);
	border-color: var(--color-gray-300);
}

.modal .cancel:hover {
	color: var(--color-gray-900);
	background-color: var(--color-gray-100);
	border-color: var(--color-gray-400);
}

.modal .confirm {
	color: var(--color-white);
	background-color: var(--color-primary);
}

.modal .confirm:hover {
	background-color: var(--color-primary-400);
}

.modal .confirm:disabled {
	background-color: var(--color-primary-200);
	cursor: auto;
}

.modal .cancel:focus-visible,
.modal .confirm:focus-visible {
	outline: 2px solid var(--outline-color);
	outline-offset: 2px;
}

.modal #input,
.modal #textarea {
	box-sizing: border-box;
	margin-top: 12px;
	padding: 0 8px;
	border: var(--border-width) solid var(--color-gray-300);
	border-radius: var(--border-radius-sm);
	font-family: var(--font-family-regular);
	font-size: var(--font-size-md);
	color: var(--color-gray-900);
	outline: none;
}

.modal #input::placeholder,
.modal #textarea::placeholder {
	color: var(--color-gray-500);
}

.modal #input {
	height: var(--interaction-medium, 32px);
	width: 100%;
}

.modal #textarea {
	padding: 6px 8px;
	height: 20rem;
	width: 40rem;
	max-height: calc(var(--max-height-modal) - 100px);
	min-height: 10rem;
	max-width: var(--max-width-modal);
	min-width: 40rem;
}

.modal #input:focus,
.modal #textarea:focus {
	border-color: var(--color-primary);
}

.modal #input:invalid,
.modal #textarea:invalid {
	border-color: var(--color-error);
}

/* Why the value is not accepted, said under the field rather than in the
   browser's own bubble. */
.modal .validity {
	min-height: 16px;
	margin-top: 4px;
	font-size: var(--font-size-sm);
	line-height: 16px;
	color: var(--color-error);
}

.modal .validity:empty {
	display: none;
}

.select-button {
	display: flex;
	justify-content: space-around;
	align-items: center;
	font-family: var(--font-family-regular);
	min-width: var(--select-button-min-width, 8em);
	padding-left: 10px;
	height: var(--select-button-height);
	font-size: var(--select-button-font-size, 12px);
	line-height: inherit;
	text-align: left;
}

.select-button svg {
	width: 2em;
	height: 2em;
}

.select-button:hover {
	color: var(--color-gray-900);
	--icon-color: var(--color-gray-900);
	fill: var(--color-gray-900);
	background-color: var(--color-gray-200);
	border-color: var(--color-gray-300);
}

.select-filter {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	width: 30em;
	padding: 0;
	margin: 0;
}

.select-filter-header {
	display: flex;
	height: 2em;
	margin: 2px 0 2px 2px;
	padding: 3px 0;
	justify-content: space-between;
	align-items: safe center;
	gap: 2px;
	border-bottom: 1px solid var(--color-gray-400);
}

.select-filter-header > .icon {
	margin-left: 0.5em;
}

.select-filter-header input {
	font-family: var(--font-family-regular);
	margin-right: 1em;
	border-width: 0;
	outline-width: 0;
	padding: 5px;
	flex-grow: 1;
}

.select-filter-header span {
	margin-right: 0.5em;
}

/* table */

th {
	border-bottom: 1px solid;
	text-align: left;
}

td {
	border-bottom: 1px solid gray;
}

table {
	overflow-x: auto;
	border-spacing: 0;
}

thead {
	font-family: var(--font-family-semi-bold);
	font-size: var(--font-size-h4);
}

tbody {
	white-space: nowrap;
}

th,
td {
	padding: 5px 10px;
	border-top-width: 0;
	border-left-width: 0;
}

th {
	position: sticky;
	top: 0;
	background: #fff;
	vertical-align: bottom;
}

th:last-child,
td:last-child {
	border-right-width: 0;
}

tr:last-child td {
	border-bottom-width: 0;
}

/* A menu in the sidebar reads as the item page does: each section a zone,
   its title on a line of its own over what it holds, and space rather than
   a rule between one zone and the next. */
.sidebar-menu {
	gap: 16px;
	padding-bottom: 12px;

	.section {
		display: flex;
		flex-direction: column;
		gap: 6px;
	}

	/* What a section holds, inside one edge, as the item page keeps its
	   properties in one card under a title of their own. */
	.section-body {
		display: flex;
		flex-direction: column;
		gap: 6px;
		padding: 8px 10px;
		border: 1px solid var(--color-gray-200);
		border-radius: var(--border-radius-lg);
		background: var(--color-white);
	}

	.section-header {
		font-size: var(--font-size-md);
		line-height: var(--font-lineHeight-5);
		font-weight: normal;
		font-family: var(--font-family-semi-bold);
		color: var(--color-gray-900);
	}
}
