/* THE PALETTE, in one place — the window, the form and the grid read it. The grid's own stylesheet paints a component
   for a page that brings nothing with it: a grey slab, a strong blue selection; these replace it, so a table reads like
   the rest of the window. */
:root {
	/* What stands behind a control's stored face: a form names a Windows one — Segoe UI — and a machine without it
	   would fall back to a serif. */
	--oes-font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--oes-window-bg: #f4f5f7;
	--oes-panel-bg: #ffffff;
	/* The palette's border tier: a pane's outline, a field's frame, a table's frame and the rule under its header. */
	--oes-border: #a8bac8;
	--oes-text: #222222;
	--oes-muted: #6b7280;
	--oes-accent: #3b50a0;

	/* A table as the thin client's theme paints one (docs/private/ui-palette.md, the tier table): its values, header and
	   footer in the theme's alternate text; its header and its rules the powder (the rule round it and under its header
	   is the border); every second row a step off white. */
	--oes-table-bg: #ffffff;
	--oes-table-text: #3f5c77;
	--oes-table-border: #e6eef5;
	--oes-table-header-bg: #e6eef5;
	--oes-table-header-text: #3f5c77;
	--oes-table-row-alt-bg: #f7f7f7;
	--oes-table-row-hover-bg: #eaecee;
	/* The row the current cell stands in — the theme's highlight 15 % over the white (the data view's row hint). */
	--oes-table-row-selected-bg: #f9eae5;
	/* The table's scroll bars, the theme's: the track the powder half way to white, the thumb the border most of the way
	   to it, darker under the mouse, the border itself dragged. */
	--oes-scroll-track: #f2f6fa;
	--oes-scroll-thumb: #c2ced8;
	--oes-scroll-thumb-hover: #b5c4d0;
	--oes-scroll-thumb-pressed: #a8bac8;
	/* A sheet's ink and paper, the same in every theme: what a template is made against, as the thin client's
	   (ibDefaultSpreadsheetTextColour, ibDefaultSpreadsheetBackgroundColour). The cells taken on it: the highlight
	   lightened to 172 over white (ibGrid's selection, #F4D9D0), as a tint laid over a cell's own fill, which stays
	   readable under it. */
	--oes-sheet-bg: #ffffff;
	--oes-sheet-text: #000000;
	--oes-sheet-cell-selected: rgb(217 119 87 / 0.28);

	/* The section panel, as the thin client paints it: a light dusty column, the sections all but white on it, the open
	   one white; its page's links in the forms' ink. Lifted toward white with the thin client's chrome (2026-11-12). */
	--oes-sections-bg: #dde4e8;
	--oes-section-bg: #f5f7f8;
	--oes-section-border: #d3dbe1;
	--oes-section-text: #343a40;
	--oes-section-ink: #3f5c77;

	/* A message's level, the mark beside it. */
	--oes-message-information: #3b82c4;
	--oes-message-warning: #d99a00;
	--oes-message-error: #c0392b;

	/* The arrows under the splash, in the picture's blue. */
	--oes-splash-arrow: #1c9ad6;

	/* The cursor, as the theme's selection (ibThemeRenderer::DrawItemSelectionRect): the cell it stands on — or the row,
	   selected whole — in the highlight, its text the highlight's; the highlight lightened by 30 % while the table is
	   not the one the keys go to. */
	--oes-table-cell-current-bg: #d97757;
	--oes-table-row-current-bg: #d97757;
	--oes-table-current-text: #ffffff;
	--oes-table-current-idle-bg: #e49f89;
	/* The folders a Hierarchical view stands in, the thin client's fill of them. */
	--oes-table-crumb-bg: #c5dce8;

	/* The text editor's ink (ibFontColorSettings' Default) — on the paper a field has. */
	--oes-editor-text: #000000;

	/* A field's width when nothing stretches it. */
	--oes-field-width: 16rem;

	/* Something to press is at least this tall — a finger, not a pointer, on a touch screen. */
	--oes-touch: 1.75rem;

	/* A tile's picture: twice a button's 16px at the desktop's root size (13px), 40px on a touch screen (16px) - the
	   engine's masters, drawn at 64, have the size to give. The thin client draws it at 32 DIP. */
	--oes-tile-picture: 2.5rem;

	/* A table's scrollbar over the window of rows it holds. */
	--oes-pager: 12px;

	/* A control's own look when its author picks none - the platform's, a colour the form leaves empty (the platform
	   style's form text and background): ink on a ground a step below white. */
	--oes-form-text: #3f5c77;
	--oes-form-bg: #eef2f6;

	/* What stands on a coloured fill - a message's mark, the offline strip. */
	--oes-on-colour: #ffffff;
	/* The light a command bar is lit by, from the top down - the thin client's: half the light it was lit by, its
	   flat form bar and its lit one met halfway (2026-11-13). */
	--oes-bar-shine-top: rgb(255 255 255 / 0.25);
	--oes-bar-shine-bottom: rgb(0 0 0 / 0.05);
	/* A command bar's default command (its entry's Default - a form's «… and close»): the thin client's default button,
	   the terracotta of its theme, the caption white. */
	--oes-default-button-bg: #d97757;
	--oes-default-button-text: #ffffff;
	/* A button under the mouse — the powder (its face at rest is the panel's white). */
	--oes-button-hover-bg: #e6eef5;
	/* What a raised thing throws: a dialog, a menu, a sheet's editor. */
	--oes-shadow: rgb(0 0 0 / 0.12);
	--oes-shadow-strong: rgb(0 0 0 / 0.15);
	/* What is laid over a window the session ended on. */
	--oes-veil: rgb(255 255 255 / 0.9);
}

/* THE DARK THEME - the same palette, the window dark and the ink light (src/window/theme.js sets data-theme from the
   person's choice, or from the machine's own when they chose the system's). Every colour our stylesheets paint with is
   one of the tokens above, and the grid's own colours are laid over with them (form.css); Web Awesome's components
   follow its wa-dark class. A colour a form or a row names for itself was chosen in the light theme: here it is
   carried, its lightness turned over and its hue kept (control.js themed, the thin client's ibStyle::Get). On the
   screen alone: paper is white, and a printout keeps the light ink. */
@media screen {
	:root[data-theme="dark"] {
		color-scheme: dark;

		--oes-window-bg: #1b1d21;
		--oes-panel-bg: #24272c;
		--oes-border: #3a3f46;
		--oes-text: #e4e6ea;
		--oes-muted: #9aa3ae;
		--oes-accent: #8197e8;

		--oes-table-bg: #24272c;
		--oes-table-text: #e4e6ea;
		--oes-editor-text: #e4e6ea;
		--oes-table-border: #3a3f46;
		--oes-table-header-bg: #2c3036;
		--oes-table-header-text: #e4e6ea;
		--oes-table-row-alt-bg: #282b30;
		--oes-table-row-hover-bg: #30343a;
		--oes-table-row-selected-bg: #413636;
		--oes-scroll-track: #24272c;
		--oes-scroll-thumb: #4a525c;
		--oes-scroll-thumb-hover: #5a636e;
		--oes-scroll-thumb-pressed: #6b7480;

		--oes-sections-bg: #1f2a33;
		--oes-section-bg: #27333d;
		--oes-section-border: #34444f;
		--oes-section-text: #dfe6ec;
		--oes-section-ink: #9cc3e6;

		--oes-message-information: #5aa3e6;
		--oes-message-warning: #e8b33a;
		--oes-message-error: #e5675a;

		--oes-splash-arrow: #3fb3ea;

		--oes-table-cell-current-bg: #e58a6c;
		--oes-table-row-current-bg: #e58a6c;
		--oes-table-current-text: #16181b;
		--oes-table-current-idle-bg: #9b6a5a;
		--oes-table-crumb-bg: #2a3d4b;

		--oes-form-text: #c9d6e2;
		--oes-form-bg: #22262b;

		--oes-on-colour: #16181b;
		--oes-bar-shine-top: rgb(255 255 255 / 0.03);
		--oes-bar-shine-bottom: rgb(0 0 0 / 0.2);
		--oes-default-button-bg: #e58a6c;
		--oes-default-button-text: #16181b;
		--oes-button-hover-bg: #30343a;
		--oes-shadow: rgb(0 0 0 / 0.45);
		--oes-shadow-strong: rgb(0 0 0 / 0.55);
		--oes-veil: rgb(20 22 26 / 0.9);
	}
}

/* THE PAGE'S SIZE — a desktop form's, as close as the thin client's: everything is in rem, so the root says it once. A
   finger keeps the browser's own size and its touch targets. */
html {
	font-size: 13px;
}

@media (pointer: coarse) {
	html {
		font-size: 16px;
	}

	:root {
		--oes-touch: 44px;
		--oes-pager: 16px;
	}
}
