/**
 * AdminFacile Fiscal Bridge — Frontend mobile-device shell.
 *
 * Styles the real interactive fiscal application inside a modern smartphone
 * frame on desktop and tablet. On a real mobile device, the decorative frame
 * is removed and the application becomes full width.
 *
 * @package AdminFacile_Fiscal_Bridge
 * @version 1.4.0
 */

/* -------------------------------------------------------------------------- */
/* Stage                                                                       */
/* -------------------------------------------------------------------------- */

.afw-fiscal-device-stage {
	--afw-device-width: 1180px;
	--afw-device-height: 760px;
	--afw-device-radius: 42px;
	--afw-device-bezel: 12px;
	--afw-device-screen-radius: 30px;
	--afw-device-bg: #090b10;
	--afw-device-screen-bg: #f4f7fb;
	--afw-device-border: rgba(255, 255, 255, 0.18);
	--afw-device-shadow:
		0 40px 90px rgba(15, 23, 42, 0.28),
		0 18px 38px rgba(15, 23, 42, 0.18),
		inset 0 0 0 1px rgba(255, 255, 255, 0.12);
	--afw-device-primary: #155eef;
	--afw-device-primary-dark: #0b3fa8;
	--afw-device-text: #0f172a;
	--afw-device-muted: #64748b;
	--afw-device-surface: #ffffff;
	--afw-device-border-soft: #e2e8f0;

	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	max-width: 100%;
	min-height: calc(var(--afw-device-height) + 90px);
	margin-right: 0;
	margin-left: 0;
	padding: 34px 24px 56px;
	overflow: hidden;
	isolation: isolate;
	background:
		radial-gradient(circle at 18% 15%, rgba(37, 99, 235, 0.16), transparent 34%),
		radial-gradient(circle at 84% 22%, rgba(79, 70, 229, 0.13), transparent 31%),
		linear-gradient(180deg, #eef4fb 0%, #f8fafc 48%, #eef2f7 100%);
}

.afw-fiscal-device-stage__backdrop {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		linear-gradient(115deg, transparent 0 32%, rgba(255, 255, 255, 0.64) 32% 33%, transparent 33% 100%),
		radial-gradient(circle at 50% 100%, rgba(15, 23, 42, 0.08), transparent 45%);
}

/* -------------------------------------------------------------------------- */
/* Device                                                                      */
/* -------------------------------------------------------------------------- */

.afw-fiscal-device {
	position: relative;
	width: min(calc(100vw - 48px), var(--afw-device-width));
	height: min(82vh, var(--afw-device-height));
	min-height: 680px;
	filter: drop-shadow(0 12px 12px rgba(15, 23, 42, 0.12));
}

.afw-fiscal-device__frame {
	position: relative;
	width: 100%;
	height: 100%;
	padding: var(--afw-device-bezel);
	overflow: hidden;
	border: 1px solid rgba(15, 23, 42, 0.76);
	border-radius: var(--afw-device-radius);
	background:
		linear-gradient(145deg, #272b33 0%, #080a0e 38%, #151820 67%, #020305 100%);
	box-shadow: var(--afw-device-shadow);
}

.afw-fiscal-device__frame::before {
	content: "";
	position: absolute;
	inset: 3px;
	pointer-events: none;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: calc(var(--afw-device-radius) - 3px);
}

.afw-fiscal-device__frame::after {
	content: "";
	position: absolute;
	inset: 10px;
	z-index: 5;
	pointer-events: none;
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: var(--afw-device-screen-radius);
}

.afw-fiscal-device__screen {
	position: relative;
	display: grid;
	grid-template-rows: 44px auto auto minmax(0, 1fr) 72px;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: var(--afw-device-screen-radius);
	background: var(--afw-device-screen-bg);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.4),
		inset 0 0 22px rgba(15, 23, 42, 0.06);
}

/* -------------------------------------------------------------------------- */
/* Hardware details                                                            */
/* -------------------------------------------------------------------------- */

.afw-fiscal-device__speaker {
	position: absolute;
	top: 7px;
	left: 50%;
	z-index: 20;
	width: 84px;
	height: 5px;
	border-radius: 999px;
	background: #020305;
	transform: translateX(-50%);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.afw-fiscal-device__home-indicator {
	position: absolute;
	bottom: 18px;
	left: 50%;
	z-index: 20;
	width: 118px;
	height: 5px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.88);
	transform: translateX(-50%);
	mix-blend-mode: difference;
}

.afw-fiscal-device__side-button {
	position: absolute;
	width: 4px;
	border-radius: 4px;
	background: linear-gradient(180deg, #32363f, #090b10);
	box-shadow: inset 1px 0 rgba(255, 255, 255, 0.12);
}

.afw-fiscal-device__side-button--left {
	top: 164px;
	left: -3px;
	height: 92px;
}

.afw-fiscal-device__side-button--right {
	top: 208px;
	right: -3px;
	height: 124px;
}

/* -------------------------------------------------------------------------- */
/* Status bar                                                                  */
/* -------------------------------------------------------------------------- */

.afw-fiscal-device__statusbar {
	position: relative;
	z-index: 7;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	min-height: 48px;
	padding: 8px 24px 4px;
	color: #ffffff;
	background: linear-gradient(135deg, #07336f 0%, #124d9f 52%, #2d43ba 100%);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 13px;
	font-weight: 700;
}

.afw-fiscal-device__time {
	justify-self: start;
	font-variant-numeric: tabular-nums;
}

.afw-fiscal-device__island {
	display: grid;
	place-items: center;
	width: 106px;
	height: 30px;
	border-radius: 999px;
	background: #020305;
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.03),
		0 1px 5px rgba(0, 0, 0, 0.24);
}

.afw-fiscal-device__island span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #2e7cf6, #08121f 58%, #000 100%);
	box-shadow: 0 0 5px rgba(46, 124, 246, 0.45);
}

.afw-fiscal-device__system-icons {
	justify-self: end;
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.afw-fiscal-device__signal {
	display: inline-flex;
	align-items: flex-end;
	gap: 2px;
	height: 13px;
}

.afw-fiscal-device__signal i {
	display: block;
	width: 3px;
	border-radius: 2px;
	background: currentColor;
}

.afw-fiscal-device__signal i:nth-child(1) { height: 4px; }
.afw-fiscal-device__signal i:nth-child(2) { height: 7px; }
.afw-fiscal-device__signal i:nth-child(3) { height: 10px; }
.afw-fiscal-device__signal i:nth-child(4) { height: 13px; }

.afw-fiscal-device__wifi {
	font-size: 17px;
	line-height: 1;
	transform: rotate(-24deg);
}

.afw-fiscal-device__battery {
	position: relative;
	display: inline-flex;
	align-items: center;
	width: 24px;
	height: 12px;
	padding: 2px;
	border: 1.5px solid currentColor;
	border-radius: 3px;
}

.afw-fiscal-device__battery::after {
	content: "";
	position: absolute;
	top: 3px;
	right: -4px;
	width: 2px;
	height: 5px;
	border-radius: 0 2px 2px 0;
	background: currentColor;
}

.afw-fiscal-device__battery i {
	display: block;
	width: 78%;
	height: 100%;
	border-radius: 1px;
	background: currentColor;
}

/* -------------------------------------------------------------------------- */
/* App bar                                                                     */
/* -------------------------------------------------------------------------- */

.afw-fiscal-device__appbar {
	position: relative;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 22px 14px;
	color: #ffffff;
	background:
		radial-gradient(circle at 84% 18%, rgba(255, 255, 255, 0.10), transparent 34%),
		linear-gradient(135deg, #07336f 0%, #124d9f 50%, #2d43ba 100%);
}

.afw-fiscal-device__brand {
	display: flex;
	align-items: center;
	min-width: 0;
	gap: 12px;
}

.afw-fiscal-device__brand-icon {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: 13px;
	background: rgba(255, 255, 255, 0.12);
	box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
	font-size: 21px;
}

.afw-fiscal-device__eyebrow {
	margin: 0 0 2px;
	overflow: hidden;
	color: rgba(255, 255, 255, 0.80);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

.afw-fiscal-device__title {
	margin: 0;
	overflow: hidden;
	color: #ffffff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 20px;
	font-weight: 750;
	line-height: 1.12;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afw-fiscal-device__menu-button {
	display: grid;
	flex: 0 0 auto;
	place-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	gap: 4px;
	border: 1px solid rgba(255, 255, 255, 0.26);
	border-radius: 13px;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.09);
	box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
	cursor: pointer;
}

.afw-fiscal-device__menu-button span {
	display: block;
	width: 17px;
	height: 2px;
	border-radius: 999px;
	background: currentColor;
}

/* -------------------------------------------------------------------------- */
/* Session                                                                     */
/* -------------------------------------------------------------------------- */

.afw-fiscal-device__session {
	position: relative;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 7px;
	min-height: 31px;
	padding: 6px 20px;
	border-bottom: 1px solid rgba(148, 163, 184, 0.20);
	color: #475569;
	background: rgba(255, 255, 255, 0.94);
	font-size: 11px;
}

.afw-fiscal-device__session span {
	color: #22c55e;
	font-size: 8px;
}

/* -------------------------------------------------------------------------- */
/* Dynamic application viewport                                                */
/* -------------------------------------------------------------------------- */

.afw-fiscal-device__viewport {
	position: relative;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(100, 116, 139, 0.46) transparent;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	background: var(--afw-device-screen-bg);
	outline: none;
}

.afw-fiscal-device__viewport::-webkit-scrollbar {
	width: 6px;
}

.afw-fiscal-device__viewport::-webkit-scrollbar-track {
	background: transparent;
}

.afw-fiscal-device__viewport::-webkit-scrollbar-thumb {
	border: 1px solid transparent;
	border-radius: 999px;
	background: rgba(100, 116, 139, 0.40);
	background-clip: padding-box;
}

.afw-fiscal-device__application {
	min-width: 0;
	padding: 0;
}

.afw-fiscal-device__application,
.afw-fiscal-device__application * {
	box-sizing: border-box;
	max-width: 100%;
}

/* Remove theme constraints from the application only inside the shell. */
.afw-fiscal-device__application .afw-fiscal-dossier {
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
}

/* -------------------------------------------------------------------------- */
/* Adapt the real shared fiscal form                                           */
/* -------------------------------------------------------------------------- */

.afw-fiscal-device__application .afw-fiscal-hero {
	margin: 0;
	padding: 18px 24px 18px;
	border-radius: 0;
}

.afw-fiscal-device__application .afw-fiscal-hero__inner,
.afw-fiscal-device__application .afw-fiscal-hero__content {
	display: block;
	width: 100%;
}

.afw-fiscal-device__application .afw-fiscal-hero h1,
.afw-fiscal-device__application .afw-fiscal-hero__title {
	max-width: 620px;
	font-size: clamp(34px, 4vw, 48px);
	line-height: 0.98;
}

.afw-fiscal-device__application .afw-fiscal-hero__actions,
.afw-fiscal-device__application .afw-fiscal-actions {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	width: 100%;
	margin-top: 18px;
}

.afw-fiscal-device__application .afw-fiscal-button {
	min-height: 42px;
	padding: 9px 10px;
	font-size: 12px;
	white-space: normal;
}

.afw-fiscal-device__application .afw-fiscal-cockpit,
.afw-fiscal-device__application .afw-fiscal-progress,
.afw-fiscal-device__application .afw-fiscal-tabs,
.afw-fiscal-device__application .afw-fiscal-panel,
.afw-fiscal-device__application [data-afw-fiscal-tab-panel] {
	margin-right: 24px;
	margin-left: 24px;
}

.afw-fiscal-device__application .afw-fiscal-cockpit {
	margin-top: 12px;
	padding: 16px;
	border: 1px solid var(--afw-device-border-soft);
	border-radius: 22px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow:
		0 10px 24px rgba(15, 23, 42, 0.07),
		inset 0 1px rgba(255, 255, 255, 0.86);
}

.afw-fiscal-device__application .afw-fiscal-cockpit h2,
.afw-fiscal-device__application .afw-fiscal-cockpit__title {
	font-size: 23px;
	line-height: 1.08;
}

.afw-fiscal-device__application .afw-fiscal-cockpit__grid,
.afw-fiscal-device__application .afw-fiscal-kpis,
.afw-fiscal-device__application .afw-fiscal-cockpit-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.afw-fiscal-device__application .afw-fiscal-kpi,
.afw-fiscal-device__application .afw-fiscal-cockpit__item {
	min-width: 0;
	padding: 12px;
	border: 1px solid #edf1f6;
	border-radius: 16px;
	background: #ffffff;
	box-shadow: 0 5px 14px rgba(15, 23, 42, 0.05);
}

.afw-fiscal-device__application .afw-fiscal-kpi strong,
.afw-fiscal-device__application .afw-fiscal-cockpit__item strong {
	font-size: 20px;
}

.afw-fiscal-device__application .afw-fiscal-progress {
	margin-top: 12px;
	padding: 15px 16px;
	border: 1px solid var(--afw-device-border-soft);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.afw-fiscal-device__application [role="tablist"],
.afw-fiscal-device__application .afw-fiscal-tabs__list {
	display: flex;
	width: 100%;
	padding: 7px 2px 10px;
	gap: 7px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.afw-fiscal-device__application [role="tablist"]::-webkit-scrollbar,
.afw-fiscal-device__application .afw-fiscal-tabs__list::-webkit-scrollbar {
	display: none;
}

.afw-fiscal-device__application [role="tab"] {
	flex: 0 0 auto;
	min-width: 145px;
	min-height: 52px;
	padding: 8px 10px;
	border: 1px solid #dbe3ee;
	border-radius: 15px;
	scroll-snap-align: start;
	background: #ffffff;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
	font-size: 11px;
	line-height: 1.2;
}

.afw-fiscal-device__application [role="tab"][aria-selected="true"] {
	border-color: rgba(21, 94, 239, 0.44);
	color: var(--afw-device-primary);
	background: #f8fbff;
	box-shadow:
		0 0 0 2px rgba(21, 94, 239, 0.08),
		0 6px 14px rgba(21, 94, 239, 0.10);
}

.afw-fiscal-device__application [data-afw-fiscal-tab-panel] {
	padding: 18px 4px 30px;
}

.afw-fiscal-device__application [data-afw-fiscal-tab-panel] h2 {
	font-size: 25px;
	line-height: 1.08;
}

.afw-fiscal-device__application [data-afw-fiscal-tab-panel] h3 {
	font-size: 18px;
	line-height: 1.18;
}

.afw-fiscal-device__application .afw-fiscal-grid,
.afw-fiscal-device__application .afw-fiscal-form-grid,
.afw-fiscal-device__application .afw-field-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.afw-fiscal-device__application input,
.afw-fiscal-device__application select,
.afw-fiscal-device__application textarea {
	width: 100%;
	min-height: 48px;
	border-radius: 12px;
	font-size: 16px;
	padding-right: 14px;
	padding-left: 14px;
}

.afw-fiscal-device__application textarea {
	min-height: 112px;
}

.afw-fiscal-device__application table {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	white-space: nowrap;
	-webkit-overflow-scrolling: touch;
}

.afw-fiscal-device__application .afw-fiscal-card,
.afw-fiscal-device__application .afw-fiscal-section,
.afw-fiscal-device__application fieldset {
	border-radius: 18px;
}

/* -------------------------------------------------------------------------- */
/* Bottom dock                                                                 */
/* -------------------------------------------------------------------------- */

.afw-fiscal-device__dock {
	position: relative;
	z-index: 8;
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	align-items: center;
	min-height: 76px;
	padding: 7px 8px 11px;
	border-top: 1px solid rgba(148, 163, 184, 0.24);
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 -10px 26px rgba(15, 23, 42, 0.08);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
}

.afw-fiscal-device__dock-item {
	display: grid;
	place-items: center;
	align-content: center;
	min-width: 0;
	min-height: 54px;
	padding: 4px 2px;
	gap: 3px;
	border: 0;
	border-radius: 14px;
	color: #64748b;
	background: transparent;
	cursor: pointer;
}

.afw-fiscal-device__dock-item span {
	font-size: 22px;
	line-height: 1;
}

.afw-fiscal-device__dock-item small {
	overflow: hidden;
	max-width: 100%;
	font-size: 9px;
	font-weight: 700;
	line-height: 1.1;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.afw-fiscal-device__dock-item.is-active {
	color: var(--afw-device-primary);
	background: rgba(21, 94, 239, 0.07);
}

.afw-fiscal-device__dock-item--primary {
	width: 54px;
	height: 54px;
	justify-self: center;
	margin-top: -28px;
	border-radius: 50%;
	color: #ffffff;
	background: linear-gradient(145deg, #2474ff, #0b4ed7);
	box-shadow:
		0 10px 22px rgba(21, 94, 239, 0.34),
		inset 0 1px rgba(255, 255, 255, 0.30);
}

.afw-fiscal-device__dock-item--primary small {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* Theme integration                                                           */
/* -------------------------------------------------------------------------- */

.afw-fiscal-frontend-page {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

body.afw-fiscal-frontend-screen .entry-content,
body.afw-fiscal-frontend-screen .site-main,
body.afw-fiscal-frontend-screen main {
	max-width: none;
}

@media (min-width: 783px) {
	body.afw-fiscal-frontend-screen .entry-content > .afw-fiscal-frontend-page {
		width: 100vw;
		max-width: 100vw;
		margin-right: calc(50% - 50vw);
		margin-left: calc(50% - 50vw);
	}
}

/* -------------------------------------------------------------------------- */
/* Dark mode                                                                   */
/* -------------------------------------------------------------------------- */

.afw-fiscal-dark-mode .afw-fiscal-device-stage {
	--afw-device-screen-bg: #0f172a;
	--afw-device-text: #f8fafc;
	--afw-device-muted: #94a3b8;
	--afw-device-surface: #111827;
	--afw-device-border-soft: #253047;

	background:
		radial-gradient(circle at 18% 15%, rgba(37, 99, 235, 0.22), transparent 34%),
		radial-gradient(circle at 84% 22%, rgba(79, 70, 229, 0.20), transparent 31%),
		linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

.afw-fiscal-dark-mode .afw-fiscal-device__viewport,
.afw-fiscal-dark-mode .afw-fiscal-device__application {
	background: #0f172a;
	color: #e5e7eb;
}

.afw-fiscal-dark-mode .afw-fiscal-device__session,
.afw-fiscal-dark-mode .afw-fiscal-device__dock {
	color: #cbd5e1;
	border-color: #263247;
	background: rgba(17, 24, 39, 0.96);
}

.afw-fiscal-dark-mode .afw-fiscal-device__application .afw-fiscal-cockpit,
.afw-fiscal-dark-mode .afw-fiscal-device__application .afw-fiscal-progress,
.afw-fiscal-dark-mode .afw-fiscal-device__application .afw-fiscal-kpi,
.afw-fiscal-dark-mode .afw-fiscal-device__application .afw-fiscal-cockpit__item,
.afw-fiscal-dark-mode .afw-fiscal-device__application [role="tab"] {
	color: #e5e7eb;
	border-color: #253047;
	background: #111827;
}

/* -------------------------------------------------------------------------- */
/* Large desktop — tablet workspace                                            */
/* -------------------------------------------------------------------------- */

@media (min-width: 1101px) {
	.afw-fiscal-device-stage {
		width: 100vw;
		max-width: 100vw;
		margin-right: calc(50% - 50vw);
		margin-left: calc(50% - 50vw);
	}

	.afw-fiscal-device-stage {
		--afw-device-width: min(96vw, 1680px);
		--afw-device-height: min(88vh, 900px);
		padding-right: 18px;
		padding-left: 18px;
	}

	.afw-fiscal-device {
		width: min(96vw, 1680px);
		height: min(88vh, 900px);
		min-height: 720px;
	}

	.afw-fiscal-device__application [data-afw-fiscal-tab-panel] {
		padding-right: 16px;
		padding-left: 16px;
	}

	.afw-fiscal-device__application .afw-fiscal-field--full,
	.afw-fiscal-device__application .afw-field--full,
	.afw-fiscal-device__application [data-afw-fiscal-span="full"] {
		grid-column: 1 / -1;
	}

	.afw-fiscal-device__application .afw-fiscal-cockpit {
		padding: 18px 20px;
	}

	.afw-fiscal-device__application .afw-fiscal-progress {
		padding: 16px 20px;
	}

	.afw-fiscal-device__application .afw-fiscal-grid,
	.afw-fiscal-device__application .afw-fiscal-form-grid,
	.afw-fiscal-device__application .afw-field-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* -------------------------------------------------------------------------- */
/* Tablet                                                                      */
/* -------------------------------------------------------------------------- */

@media (min-width: 783px) and (max-width: 1100px) {
	.afw-fiscal-device-stage {
		--afw-device-width: min(96vw, 1040px);
		--afw-device-height: min(78vh, 720px);
		--afw-device-radius: 36px;
		--afw-device-screen-radius: 25px;

		width: 100vw;
		max-width: 100vw;
		min-height: calc(var(--afw-device-height) + 64px);
		margin-right: calc(50% - 50vw);
		margin-left: calc(50% - 50vw);
		padding: 24px 16px 40px;
	}

	.afw-fiscal-device {
		width: min(calc(100vw - 32px), 1040px);
		height: min(78vh, 720px);
		min-height: 620px;
	}

	.afw-fiscal-device__application .afw-fiscal-hero__actions,
	.afw-fiscal-device__application .afw-fiscal-actions {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.afw-fiscal-device__application .afw-fiscal-cockpit__grid,
	.afw-fiscal-device__application .afw-fiscal-kpis,
	.afw-fiscal-device__application .afw-fiscal-cockpit-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.afw-fiscal-device__application .afw-fiscal-grid,
	.afw-fiscal-device__application .afw-fiscal-form-grid,
	.afw-fiscal-device__application .afw-field-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* -------------------------------------------------------------------------- */
/* Real mobile — structural handoff to adminfacile-fiscal-mobile.css           */
/* -------------------------------------------------------------------------- */

/*
 * This file owns the simulated device on tablet and desktop.
 * On a real smartphone it only removes the decorative hardware. The complete
 * business layout is intentionally delegated to adminfacile-fiscal-mobile.css,
 * which is enqueued after this stylesheet.
 */
@media (max-width: 782px) {
	.afw-fiscal-device-stage {
		--afw-device-width: 100%;
		--afw-device-height: auto;
		--afw-device-radius: 0;
		--afw-device-bezel: 0;
		--afw-device-screen-radius: 0;

		position: relative;
		left: auto;
		right: auto;
		display: block;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		min-height: 100dvh;
		margin: 0;
		padding: 0;
		overflow-x: clip;
		overflow-y: visible;
		background: var(--afw-device-screen-bg);
		transform: none;
	}

	.afw-fiscal-device-stage__backdrop,
	.afw-fiscal-device__speaker,
	.afw-fiscal-device__side-button,
	.afw-fiscal-device__home-indicator,
	.afw-fiscal-device__island {
		display: none;
	}

	.afw-fiscal-device,
	.afw-fiscal-device__frame,
	.afw-fiscal-device__screen,
	.afw-fiscal-device__viewport,
	.afw-fiscal-device__application {
		left: auto;
		right: auto;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		margin: 0;
		transform: none;
	}

	.afw-fiscal-device {
		height: auto;
		min-height: 100dvh;
		filter: none;
	}

	.afw-fiscal-device__frame {
		height: auto;
		min-height: 100dvh;
		padding: 0;
		overflow: visible;
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
	}

	.afw-fiscal-device__frame::before,
	.afw-fiscal-device__frame::after {
		display: none;
	}

	.afw-fiscal-device__screen {
		display: flex;
		flex-direction: column;
		height: auto;
		min-height: 100dvh;
		overflow: visible;
		border-radius: 0;
		background: var(--afw-device-screen-bg);
		box-shadow: none;
	}

	.afw-fiscal-device__viewport,
	.afw-fiscal-device__application {
		overflow-x: clip;
	}

	.afw-fiscal-device__application,
	.afw-fiscal-device__application * {
		min-width: 0;
	}

	/*
	 * Do not define mobile grids, margins or typography here.
	 * The dedicated Mobile Design System owns those rules.
	 */
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                              */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.afw-fiscal-device-stage *,
	.afw-fiscal-device-stage *::before,
	.afw-fiscal-device-stage *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}


/* -------------------------------------------------------------------------- */
/* Full-bleed protection against WordPress theme containers                    */
/* -------------------------------------------------------------------------- */

/*
 * Full-bleed is useful for the simulated device only on tablet and desktop.
 * On smartphones, forcing 100vw and visible overflow causes the whole page to
 * slide horizontally, so mobile remains strictly container-safe.
 */
@media (min-width: 783px) {
	body.afw-fiscal-frontend-screen,
	body.afw-fiscal-frontend-screen #page,
	body.afw-fiscal-frontend-screen .site,
	body.afw-fiscal-frontend-screen .site-content,
	body.afw-fiscal-frontend-screen .content-area,
	body.afw-fiscal-frontend-screen .site-main,
	body.afw-fiscal-frontend-screen .entry-content {
		max-width: none;
		overflow-x: clip;
	}

	body.afw-fiscal-frontend-screen .afw-fiscal-frontend-page,
	body.afw-fiscal-frontend-screen .afw-fiscal-device-stage {
		width: 100vw;
		max-width: 100vw;
	}

	body.afw-fiscal-frontend-screen .afw-fiscal-frontend-page {
		margin-right: calc(50% - 50vw);
		margin-left: calc(50% - 50vw);
	}
}

@media (max-width: 782px) {
	body.afw-fiscal-frontend-screen,
	body.afw-fiscal-frontend-screen #page,
	body.afw-fiscal-frontend-screen .site,
	body.afw-fiscal-frontend-screen .site-content,
	body.afw-fiscal-frontend-screen .content-area,
	body.afw-fiscal-frontend-screen .site-main,
	body.afw-fiscal-frontend-screen .entry-content,
	body.afw-fiscal-frontend-screen .afw-fiscal-frontend-page,
	body.afw-fiscal-frontend-screen .afw-fiscal-device-stage {
		left: auto;
		right: auto;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		margin-right: 0;
		margin-left: 0;
		overflow-x: clip;
		transform: none;
	}
}

/* -------------------------------------------------------------------------- */
/* Mobile interaction safety — buttons and links                              */
/* -------------------------------------------------------------------------- */

/*
 * On a real smartphone, only the application viewport and the bottom dock
 * should receive pointer events. Decorative layers and pseudo-elements remain
 * non-interactive. This block is strictly mobile-scoped and does not alter the
 * desktop or tablet device presentation.
 */
@media (max-width: 782px) {
	.afw-fiscal-device-stage__backdrop,
	.afw-fiscal-device__speaker,
	.afw-fiscal-device__side-button,
	.afw-fiscal-device__home-indicator,
	.afw-fiscal-device__island,
	.afw-fiscal-device__system-icons,
	.afw-fiscal-device__frame::before,
	.afw-fiscal-device__frame::after,
	.afw-fiscal-device__screen::before,
	.afw-fiscal-device__screen::after {
		pointer-events: none !important;
	}

	.afw-fiscal-device__screen {
		position: relative;
		isolation: isolate;
	}

	.afw-fiscal-device__viewport {
		position: relative;
		z-index: 1;
		flex: 1 1 auto;
		pointer-events: auto !important;
		touch-action: pan-y;
		-webkit-overflow-scrolling: touch;
	}

	.afw-fiscal-device__application {
		position: relative;
		z-index: 2;
		pointer-events: auto !important;
	}

	.afw-fiscal-device__application button,
	.afw-fiscal-device__application a,
	.afw-fiscal-device__application input,
	.afw-fiscal-device__application select,
	.afw-fiscal-device__application textarea,
	.afw-fiscal-device__application summary,
	.afw-fiscal-device__application [role="button"],
	.afw-fiscal-device__application [role="tab"] {
		position: relative;
		z-index: 3;
		pointer-events: auto !important;
		touch-action: manipulation;
		-webkit-tap-highlight-color: rgba(21, 94, 239, 0.14);
	}

	.afw-fiscal-device__application button:disabled,
	.afw-fiscal-device__application input:disabled,
	.afw-fiscal-device__application select:disabled,
	.afw-fiscal-device__application textarea:disabled {
		pointer-events: none !important;
	}

	.afw-fiscal-device__statusbar,
	.afw-fiscal-device__appbar,
	.afw-fiscal-device__session {
		position: relative;
		z-index: 4;
	}

	.afw-fiscal-device__dock {
		position: relative;
		z-index: 5;
		pointer-events: auto !important;
	}

	.afw-fiscal-device__dock-item,
	.afw-fiscal-device__menu-button {
		pointer-events: auto !important;
		touch-action: manipulation;
	}
}

