/* Retain the upstream palette, typography, controls, and selected theme. */
html { scrollbar-gutter: stable; }
body:has(.hub-sales-dispatch-first-dialog.show),
body:has(.hub-payroll-posting-dialog.show),
body:has(.hub-loan-dialog-active),
body.hub-payroll-posting-modal-active {
	overflow-y: auto !important;
	padding-right: 0 !important;
	padding-left: 0 !important;
}
/* Mirror Flow's native transcript gutter and keep code payloads readable. */
html[lang="ckb"] .flow-transcript::before { left: auto; right: 90px; }
html[lang="ckb"] .flow-transcript .body { padding-left: 0; padding-right: 20px; }
html[lang="ckb"] .flow-transcript .text { unicode-bidi: plaintext; }
html[lang="ckb"] .flow-transcript pre.json { direction: ltr; text-align: left; }
/* Native Desk launcher only: retain theme tokens and original app navigation. */
.desktop-wrapper {
	min-height: 100dvh;
	background: linear-gradient(rgb(15 30 33 / 10%), rgb(15 30 33 / 24%)),
		url("../images/home-landscape.png") center center / cover no-repeat;
	background-attachment: fixed;
}
.desktop-wrapper .desktop-navbar {
	background: var(--fg-color);
	background: color-mix(in srgb, var(--fg-color) 96%, transparent);
	border-bottom: 1px solid var(--border-color);
	box-shadow: 0 2px 16px rgb(0 0 0 / 8%);
}
.desktop-wrapper .desktop-container > .icons-container {
	width: min(100%, 960px);
	margin-top: clamp(32px, 7vh, 80px);
	padding: 24px;
}
.desktop-wrapper .desktop-container > .icons-container > .icons {
	grid-template-columns: repeat(6, minmax(0, 1fr));
	grid-template-rows: none;
	gap: 16px;
}
.desktop-wrapper .desktop-container > .icons-container > .icons > .desktop-icon {
	width: 100%;
	height: auto;
	min-height: 136px;
	padding: 18px 10px 14px;
	color: var(--text-color);
	background: var(--fg-color);
	background: color-mix(in srgb, var(--fg-color) 96%, transparent);
	border: 1px solid var(--border-color);
	border-radius: 20px;
	box-shadow: 0 6px 20px rgb(0 0 0 / 12%);
	transition: background-color 120ms ease, border-color 120ms ease;
}
.desktop-wrapper .desktop-container > .icons-container > .icons > .desktop-icon:hover {
	background: var(--fg-color);
	border-color: var(--text-muted);
}
.desktop-wrapper .desktop-container > .icons-container > .icons > .desktop-icon:focus-visible {
	outline: 3px solid var(--primary);
	outline-offset: 3px;
}
.desktop-wrapper .desktop-container > .icons-container > .icons > .desktop-icon > .icon-caption {
	height: auto;
}
.desktop-wrapper .desktop-container > .icons-container > .icons > .desktop-icon > .icon-caption > .icon-title {
	white-space: normal;
	overflow-wrap: anywhere;
	line-height: 1.5;
}
/* Financial report dialogs write body overflow on show/hide. Keep the desktop scroll
   container stable without overriding native mobile-sidebar scroll locking. */
@media (min-width: 769px) {
	body:is(
		[data-route="query-report/General Ledger"],
		[data-route="query-report/Profit and Loss Statement"],
		[data-route="query-report/Balance Sheet"],
		[data-route="query-report/Cash Flow"]
	) { overflow: auto !important; }
	body:is(
		[data-route="query-report/General Ledger"],
		[data-route="query-report/Profit and Loss Statement"],
		[data-route="query-report/Balance Sheet"],
		[data-route="query-report/Cash Flow"]
	).modal-open {
		padding-right: 0 !important;
		padding-left: 0 !important;
	}
}
/* Keep the mixed-currency receipt form aligned when native confirmation opens. */
@media (min-width: 769px) {
	body[data-route^="Form/Payment Entry/"].modal-open:has(.hub-mixed-customer-receipt) {
		overflow: auto !important;
		padding-right: 0 !important;
		padding-left: 0 !important;
	}
}
/* Bootstrap compensates for hidden scrollbars; the reserved gutter already does. */
body.modal-open:has(.desktop-wrapper) {
	overflow-y: auto;
	padding-right: 0 !important;
	padding-left: 0 !important;
}
@media (max-width: 760px) {
	.desktop-wrapper .desktop-container > .icons-container > .icons {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 12px;
	}
	.desktop-wrapper .desktop-container > .icons-container {
		margin-top: 16px;
		padding: 12px;
	}
	.desktop-wrapper .desktop-container {
		padding: 0;
	}
}
@media (max-width: 380px) {
	.desktop-wrapper .desktop-container > .icons-container > .icons {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
.hub-app { min-width: 0; }
.layout-main-section .hub-app { padding: var(--padding-lg, 24px); }
.hub-app .hub-record-content bdi { overflow-wrap: anywhere; }
.hub-app .hub-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 12px; }
.hub-app .hub-record { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 12px; border-block-end: 1px solid var(--border-color); overflow-wrap: anywhere; }
.hub-app .hub-record-content { flex: 1; min-width: 140px; }
.hub-app .hub-record-content p { margin-block: 4px; }
.hub-app .hub-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: var(--padding-lg, 24px); color: var(--text-color); background: var(--fg-color); border: 1px solid var(--border-color); }
.hub-app .hub-dialog:not([open]) { display: none; }
.hub-app .hub-dialog::backdrop { background: var(--modal-backdrop-color, rgb(0 0 0 / 50%)); }
.hub-app input[dir="ltr"] { text-align: left; }
