/* Fonts are served from this deployment rather than fetched from a third party.
   The client owns this system and runs it on their own server: an external call
   on every page load is a dependency they did not ask for, it leaks who is
   using the system, and it is the first thing to fail on a phone with one bar
   in a truck. 64 KB, cached, and it works offline. */

@font-face {
	font-family: 'IBM Plex Sans';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('/assets/fonts/plex-sans-400.woff2') format('woff2');
}
@font-face {
	font-family: 'IBM Plex Sans';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('/assets/fonts/plex-sans-500.woff2') format('woff2');
}
@font-face {
	font-family: 'IBM Plex Sans';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('/assets/fonts/plex-sans-600.woff2') format('woff2');
}
@font-face {
	font-family: 'IBM Plex Sans Condensed';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('/assets/fonts/plex-condensed-600.woff2') format('woff2');
}
@font-face {
	font-family: 'IBM Plex Sans Condensed';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('/assets/fonts/plex-condensed-700.woff2') format('woff2');
}
@font-face {
	font-family: 'IBM Plex Mono';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('/assets/fonts/plex-mono-400.woff2') format('woff2');
}

/* =============================================================================
   Service Business OS — base stylesheet
   Linked first on every screen. Page-specific rules go in a <style> block
   below this link, never inline on elements.
   ========================================================================== */

:root {
	/* Dominant: deep petrol, the colour of the chassis.
	   Accent: amber, used sparingly and only where the eye must go. */
	--petrol-900: #0e1f27;
	--petrol-800: #14303c;
	--petrol-700: #1b4152;
	--petrol-600: #235468;
	--petrol-400: #4d8299;
	--petrol-200: #a8c4d0;

	--amber-600:  #b4610a;
	--amber-500:  #d97706;
	--amber-400:  #f59e0b;
	--amber-100:  #fef3c7;

	--ink:        #16232a;
	--ink-soft:   #4a5f6a;
	--ink-faint:  #7c909b;

	--surface:        #ffffff;
	--surface-sunk:   #f4f7f8;
	--surface-raised: #ffffff;
	--stripe:         #f8fafb;

	--line:        #c3d2d9;
	--line-strong: #93a9b4;

	--ok:      #16794a;
	--ok-bg:   #dcfce7;
	--warn:    #a16207;
	--warn-bg: #fef9c3;
	--bad:     #b02a2a;
	--bad-bg:  #fee2e2;
	--info:    var(--petrol-700);
	--info-bg: #e0f0f6;

	--font-body: 'IBM Plex Sans', 'Segoe UI', 'Helvetica Neue', sans-serif;
	--font-head: 'IBM Plex Sans Condensed', 'IBM Plex Sans', 'Segoe UI', sans-serif;
	--font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;

	--radius:    4px;
	--radius-lg: 6px;
	--pad:       14px;
	--gap:       6px;
	--control-h: 32px;
	--row-h:     32px;

	--shadow:    0 1px 2px rgba(14, 31, 39, .10);
	--shadow-lg: 0 4px 14px rgba(14, 31, 39, .14);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--ink:        #e6eef2;
		--ink-soft:   #a9bcc6;
		--ink-faint:  #7b909c;

		--surface:        #101f26;
		--surface-sunk:   #0b171d;
		--surface-raised: #162a33;
		--stripe:         #13252d;

		--line:        #2a4652;
		--line-strong: #3d6373;

		--ok-bg:   #08301f;
		--warn-bg: #33270a;
		--bad-bg:  #3a1414;
		--info-bg: #0e2c38;
	}
}

:root[data-theme="dark"] {
	--ink:        #e6eef2;
	--ink-soft:   #a9bcc6;
	--ink-faint:  #7b909c;

	--surface:        #101f26;
	--surface-sunk:   #0b171d;
	--surface-raised: #162a33;
	--stripe:         #13252d;

	--line:        #2a4652;
	--line-strong: #3d6373;

	--ok-bg:   #08301f;
	--warn-bg: #33270a;
	--bad-bg:  #3a1414;
	--info-bg: #0e2c38;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 14px;
	line-height: 1.4;
	color: var(--ink);
	background: var(--surface-sunk);
	-webkit-font-smoothing: antialiased;
}

/* ---- Typography ---------------------------------------------------------- */

h1, h2, h3, h4 {
	font-family: var(--font-head);
	font-weight: 600;
	letter-spacing: .01em;
	margin: 0 0 8px;
	color: var(--ink);
}

h1 { font-size: 1.4rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; font-weight: 700; }
h4 { font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }

p  { margin: 0 0 10px; max-width: 700px; }

a { color: var(--petrol-700); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono, .num { font-family: var(--font-mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }

.muted  { color: var(--ink-soft); }
.faint  { color: var(--ink-faint); }
.right  { text-align: right; }
.nowrap { white-space: nowrap; }

/* Money reads down a column when the decimal points line up. */
.right-align { text-align: right; }

/* Moving between days, and the heading of one visit. */
.day-bar    { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day-title  { font-size: 1.05rem; }
.visit-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.visit-time { font-weight: 600; font-variant-numeric: tabular-nums; }

/* The number the whole estimate comes to, where the eye lands first. */
.total-headline { font-size: 1.3rem; font-weight: 600; }

/* The option the customer is taking, marked without shouting. */
.option-chosen { border-left: 3px solid var(--amber-500); }

.quantity-input { width: 64px; height: 28px; padding: 2px 6px; font-size: 13px; }

/* What a job can do next: one move per line, so a reason box never wanders
   away from the button it belongs to. */
.job-moves { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.job-move  { display: flex; align-items: center; gap: 8px; margin: 0; }
.job-move .btn-sm { min-width: 128px; }
.reason-input { width: 260px; height: 28px; padding: 2px 8px; font-size: 13px; }
.data td.right-align, .data th.right-align { text-align: right; }

/* Moving between days, and the heading of one visit. */
.day-bar    { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day-title  { font-size: 1.05rem; }
.visit-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.visit-time { font-weight: 600; font-variant-numeric: tabular-nums; }

/* The number the whole estimate comes to, where the eye lands first. */
.total-headline { font-size: 1.3rem; font-weight: 600; }

/* The option the customer is taking, marked without shouting. */
.option-chosen { border-left: 3px solid var(--amber-500); }

.quantity-input { width: 64px; height: 28px; padding: 2px 6px; font-size: 13px; }

/* What a job can do next: one move per line, so a reason box never wanders
   away from the button it belongs to. */
.job-moves { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.job-move  { display: flex; align-items: center; gap: 8px; margin: 0; }
.job-move .btn-sm { min-width: 128px; }
.reason-input { width: 260px; height: 28px; padding: 2px 8px; font-size: 13px; }
@media (max-width: 720px) {
	.data.reflow td.right-align { text-align: left; }
}

/* ---- App shell ----------------------------------------------------------- */

/* Only ever seen on a narrow screen, where the sidebar is folded away. Named
   with its parent so it beats .btn, which is declared later and would
   otherwise put it back on every screen. */
.topbar .menu-toggle { display: none; }

.app {
	display: grid;
	grid-template-columns: 216px 1fr;
	grid-template-rows: auto 1fr;
	grid-template-areas: "brand topbar" "sidebar main";
	min-height: 100vh;
}

.brand {
	grid-area: brand;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 var(--pad);
	height: 48px;
	background: var(--petrol-900);
	color: #fff;
	font-family: var(--font-head);
	font-weight: 700;
	letter-spacing: .04em;
	border-bottom: 1px solid var(--petrol-800);
}
.brand .mark {
	width: 20px; height: 20px;
	border-radius: 3px;
	background: var(--amber-500);
	flex: none;
}
.brand .mark-image { width: 30px; height: 30px; object-fit: contain; flex: none; }

.topbar {
	grid-area: topbar;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 var(--pad);
	height: 48px;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}
.topbar .spacer { flex: 1; }

.sidebar {
	grid-area: sidebar;
	background: var(--petrol-900);
	padding: 10px 0;
	overflow-y: auto;
}
.sidebar a {
	display: block;
	padding: 9px var(--pad);
	color: #eef3f8;
	font-size: 1.05rem;
	line-height: 1.3;
	border-left: 3px solid transparent;
}
.sidebar a:hover { background: var(--petrol-800); color: #fff; text-decoration: none; }
.sidebar a.active {
	background: var(--petrol-800);
	color: #fff;
	border-left-color: var(--amber-500);
	font-weight: 600;
}
.sidebar .group {
	padding: 14px var(--pad) 6px;
	font-family: var(--font-head);
	font-size: .84rem;
	text-transform: uppercase;
	letter-spacing: .09em;
	color: var(--petrol-200);
}
.sidebar summary.group {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-right: var(--pad);
	user-select: none;
}
.sidebar summary.group::-webkit-details-marker { display: none; }
.sidebar summary.group::after {
	content: '';
	width: 7px; height: 7px;
	border-right: 2px solid var(--petrol-200);
	border-bottom: 2px solid var(--petrol-200);
	transform: rotate(-45deg);
	transition: transform .15s;
}
.sidebar details[open] summary.group::after { transform: rotate(45deg); }
.sidebar summary.group:hover { color: #fff; }
.sidebar .nav-group a { padding-left: calc(var(--pad) + 12px); }

main {
	grid-area: main;
	padding: var(--pad);
	overflow-x: auto;
}

.page-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin-bottom: 12px;
}
/* A long organization name must not squeeze itself into a narrow column and
   push the badges into the middle of the page. It takes the width it needs and
   anything after it wraps below. */
.page-head h1 { flex: 1 1 100%; margin-bottom: 2px; }
.page-head h1 + * { margin-left: 0; }
.page-head .spacer { flex: 1; }

/* ---- Layout: multi-column by default ------------------------------------- */

/* A grid child is allowed to be narrower than its widest content, so a wide
   table inside a card scrolls in its own box instead of pushing the column —
   and the last column off the side of the page. */
.grid > *, .grid-wide > *, .grid-stats > *, .split > * { min-width: 0; }

.grid       { display: grid; gap: var(--pad); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-stats { display: grid; gap: var(--pad); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-wide  { display: grid; gap: var(--pad); grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }

/* List on the left, detail on the right. */
.split { display: grid; gap: var(--pad); grid-template-columns: 25% 1fr; }

@media (max-width: 900px) {
	/* Three rows now, not two: with the desktop's "auto 1fr" the topbar took
	   every spare pixel and the page began a screen and a half down. */
	.app {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto 1fr;
		grid-template-areas: "brand" "topbar" "main";
	}
	.sidebar { display: none; }
	/* The folded-away navigation takes the page over when it is opened, rather
	   than being drawn on top of it — they share the same grid cell. */
	.sidebar.open { display: block; grid-area: main; }
	.sidebar.open ~ main { display: none; }
	.topbar .menu-toggle { display: inline-flex; }
	.split { grid-template-columns: 1fr; }
}

/* ---- Cards --------------------------------------------------------------- */

.card {
	background: var(--surface-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: var(--pad);
	box-shadow: var(--shadow);
}
.card > h3, .card > h4 { margin-top: 0; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .label {
	font-family: var(--font-head);
	font-size: .74rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--ink-soft);
}
.stat .value {
	font-family: var(--font-head);
	font-size: 1.6rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}

/* ---- Forms --------------------------------------------------------------- */

.form { display: grid; gap: var(--pad); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.form .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: var(--gap); }
.field > label {
	font-size: .82rem;
	font-weight: 500;
	color: var(--ink-soft);
}
.field .hint { font-size: .78rem; color: var(--ink-faint); }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="time"], input[type="search"],
select, textarea {
	width: 100%;
	height: var(--control-h);
	padding: 0 9px;
	font-family: inherit;
	font-size: 14px;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
}
textarea { height: auto; min-height: 72px; padding: 7px 9px; resize: vertical; }
select { padding-right: 4px; }

input:focus, select:focus, textarea:focus {
	outline: 2px solid var(--amber-400);
	outline-offset: -1px;
	border-color: var(--amber-500);
}
input:disabled, select:disabled, textarea:disabled {
	background: var(--surface-sunk);
	color: var(--ink-faint);
}
input.error, select.error, textarea.error { border-color: var(--bad); }

.field-error { font-size: .78rem; color: var(--bad); }

/* Password fields get a show/hide toggle. */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.password-wrap button {
	position: absolute;
	top: 0; right: 0;
	height: var(--control-h);
	padding: 0 9px;
	border: 0;
	background: none;
	color: var(--petrol-700);
	font-size: .78rem;
	font-weight: 500;
	cursor: pointer;
}

/* ---- Buttons ------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: var(--control-h);
	padding: 0 13px;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	cursor: pointer;
	white-space: nowrap;
}
.btn:hover { background: var(--surface-sunk); }
.btn:focus-visible { outline: 2px solid var(--amber-400); outline-offset: 1px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
	background: var(--petrol-700);
	border-color: var(--petrol-700);
	color: #fff;
}
.btn-primary:hover { background: var(--petrol-800); }

.btn-accent {
	background: var(--amber-500);
	border-color: var(--amber-600);
	color: #2a1503;
}
.btn-accent:hover { background: var(--amber-400); }

.btn-danger { color: var(--bad); border-color: var(--bad); background: var(--surface); }
.btn-danger:hover { background: var(--bad-bg); }

.btn-sm { height: 26px; padding: 0 9px; font-size: 12.5px; }

/* ---- Tables -------------------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-raised); }

table.data {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
}
table.data th {
	height: var(--row-h);
	padding: 0 12px;
	text-align: left;
	font-family: var(--font-head);
	font-size: .76rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .07em;
	color: var(--ink-soft);
	background: var(--surface-sunk);
	border-bottom: 1px solid var(--line-strong);
	white-space: nowrap;
}
table.data td {
	height: var(--row-h);
	padding: 0 12px;
	border-bottom: 1px solid var(--line);
}
table.data tbody tr:nth-child(even) { background: var(--stripe); }
table.data tbody tr:hover { background: var(--info-bg); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty {
	padding: 28px var(--pad);
	text-align: center;
	color: var(--ink-soft);
}

/* ---- Badges and status --------------------------------------------------- */

.badge {
	display: inline-flex;
	align-items: center;
	height: 20px;
	padding: 0 7px;
	border-radius: 3px;
	font-family: var(--font-head);
	font-size: .72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
	white-space: nowrap;
}
.badge-ok   { background: var(--ok-bg);   color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad  { background: var(--bad-bg);  color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ---- Notices ------------------------------------------------------------- */

.notice {
	padding: 9px 12px;
	border: 1px solid var(--line-strong);
	border-left-width: 3px;
	border-radius: var(--radius);
	margin-bottom: 12px;
	font-size: 13.5px;
}
.notice-ok   { background: var(--ok-bg);   border-left-color: var(--ok);   color: var(--ok); }
.notice-warn { background: var(--warn-bg); border-left-color: var(--warn); color: var(--warn); }
.notice-bad  { background: var(--bad-bg);  border-left-color: var(--bad);  color: var(--bad); }
.notice-info { background: var(--info-bg); border-left-color: var(--info); color: var(--info); }

/* ---- Tabs ---------------------------------------------------------------- */

/* ---- Centred single-panel screens (login, errors) ------------------------ */

.centre-screen {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: var(--pad);
	background:
		radial-gradient(1100px 460px at 50% -10%, var(--info-bg), transparent 70%),
		var(--surface-sunk);
}
.panel {
	width: 100%;
	max-width: 380px;
	background: var(--surface-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 24px;
	box-shadow: var(--shadow-lg);
}
.panel-head { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.panel-head .mark {
	width: 26px; height: 26px;
	border-radius: 4px;
	background: var(--amber-500);
	flex: none;
}
.panel-head .title {
	font-family: var(--font-head);
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: .03em;
}
.panel-head.has-logo { justify-content: center; margin-bottom: 14px; }
.panel-head .logo { display: block; max-width: 280px; width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- Typeahead ----------------------------------------------------------- */

.typeahead-wrap { position: relative; }

.typeahead-results {
	position: absolute;
	top: calc(var(--control-h) + 2px);
	left: 0;
	right: 0;
	z-index: 40;
	max-height: 320px;
	overflow-y: auto;
	background: var(--surface-raised);
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
}
.typeahead-results a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 11px;
	color: var(--ink);
	border-bottom: 1px solid var(--line);
}
.typeahead-results a:last-child { border-bottom: 0; }
.typeahead-results a:hover,
.typeahead-results a.active { background: var(--info-bg); text-decoration: none; }
.typeahead-empty { padding: 12px; color: var(--ink-soft); font-size: 13.5px; }

/* ---- Breadcrumbs --------------------------------------------------------- */

.crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: .84rem;
	margin-bottom: 8px;
	color: var(--ink-soft);
}
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--petrol-700); }
.crumbs .sep { color: var(--ink-faint); }

/* ---- Definition rows ----------------------------------------------------- */

.detail-rows { display: grid; gap: 2px; }
.detail-row {
	display: grid;
	grid-template-columns: 150px 1fr;
	gap: 10px;
	padding: 5px 0;
	border-bottom: 1px solid var(--line);
	font-size: 13.5px;
}
.detail-row:last-child { border-bottom: 0; }
.detail-row .k { color: var(--ink-soft); }

@media (max-width: 640px) {
	.detail-row { grid-template-columns: 1fr; gap: 2px; }
	/* Lists become cards rather than a table scrolled sideways on a phone. */
	table.data.reflow thead { display: none; }
	table.data.reflow, table.data.reflow tbody, table.data.reflow tr, table.data.reflow td { display: block; width: 100%; }
	table.data.reflow tr {
		border: 1px solid var(--line);
		border-radius: var(--radius);
		margin-bottom: 8px;
		padding: 6px 0;
	}
	table.data.reflow td { height: auto; border: 0; padding: 4px 12px; }
	table.data.reflow td::before {
		content: attr(data-label) ": ";
		color: var(--ink-soft);
		font-size: .78rem;
	}
	table.data.reflow td:first-child::before { content: ""; }
	table.data.reflow td:first-child { font-weight: 600; font-size: 15px; }
}


/* ---- Utilities -----------------------------------------------------------
   These exist so markup carries no inline style attributes. The content
   security policy blocks those outright, and the coding standard forbids them
   regardless: a style written into a page is one nobody can find later.
   -------------------------------------------------------------------------- */

.mt-0  { margin-top: 0; }
.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mb-0  { margin-bottom: 0; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 14px; }
.m-0   { margin: 0; }

.row        { display: flex; align-items: center; gap: 8px; }
.row-wrap   { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.grow       { flex: 1; }
.right-end  { display: flex; justify-content: flex-end; }
.actions    { display: flex; gap: 8px; margin-top: 16px; }

.checks       { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.check        { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.check input  { width: auto; height: auto; }

.small     { font-size: .82rem; }
.smaller   { font-size: .78rem; }
.tight     { font-size: 13px; }
.value-sm  { font-size: 1.1rem; }
.uuid      { font-size: .8rem; }

.entry     { padding: 10px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.group-row { background: var(--surface-sunk); }
.inline-form { margin: 0; display: inline-block; }
.note-inline { margin: 8px 0 0; padding: 6px 9px; font-size: .82rem; }
.clickable { cursor: pointer; }

/* A label only a screen reader needs — the control beside it is obvious to
   anyone who can see it, and the label would only be noise on the page. */
.sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.float-right { float: right; }

.full-width    { width: 100%; }
.weight-normal { font-weight: 400; }
.col-wide      { min-width: 260px; }
.auto-size     { width: auto; height: auto; }

/* Buttons in a table's action column stay on one line rather than stacking. */
.data td.actions-cell { white-space: nowrap; }
.data td.actions-cell .btn-sm + .inline-form,
.data td.actions-cell .inline-form + .inline-form { margin-left: 4px; }

/* One way of reaching somebody: the value and its controls on one line. */
.method-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.method-row .btn-sm { padding: 1px 7px; }

/* The question asked before something is destroyed. */
.confirm {
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 16px 20px;
	max-width: 420px;
	color: var(--ink);
	background: var(--surface);
}
.confirm h3 { margin: 0 0 6px; }
.confirm p { margin: 0 0 14px; }
.confirm::backdrop { background: rgb(0 0 0 / 45%); }

/* ---- Files and photographs ----------------------------------------------- */

.file-grid {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.file-card {
	padding: 10px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: var(--surface-raised);
}
.file-thumb {
	display: block;
	width: 100%;
	height: 140px;
	object-fit: cover;
	border-radius: var(--radius);
	background: var(--surface-sunk);
	margin-bottom: 8px;
}
.file-name { font-weight: 600; overflow-wrap: anywhere; }

/* ---- Signing on a screen -------------------------------------------------- */

.signature-pad canvas {
	width: 100%;
	max-width: 600px;
	height: 180px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: var(--surface);
	touch-action: none;
	cursor: crosshair;
}
.signature-thumb { height: 90px; object-fit: contain; background: var(--surface); }
