/* The staff launch surface uses the venue's paired foreground/background tokens.
   Keep these rules local to operation: customer menus and management are separate. */
body.operation-page {
	--venue-surface-raised: color-mix(
		in srgb,
		var(--venue-surface, #fffdf8) 90%,
		var(--venue-surface-text, #211c18)
	);
	--operation-panel-raised: color-mix(
		in srgb,
		var(--venue-panel, #fff9f0) 92%,
		var(--venue-panel-text, #211c18)
	);
}

.operation-page .app-header .brand {
	min-width: 0;
	flex: 1 1 auto;
	line-height: 1.2;
}

.operation-page .app-header .header-end,
.operation-page .app-header .header-link {
	flex: 0 0 auto;
	white-space: nowrap;
}

.operation-page #alert-status {
	color: var(--venue-muted, #675e56);
}

/* Confirmed customer items are a compact list. Production tickets retain their
   full instructions; only the selected comanda discloses secondary details. */
.operation-page #table-items {
	gap: 8px;
}
.operation-page #table-items .order-item {
	padding: 12px 14px;
	border-width: 1px;
	color: var(--venue-surface-text, #211c18);
	background: var(--venue-surface, #fffdf8);
}
.operation-page #table-items .item-head {
	gap: 8px;
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--venue-muted, #675e56);
}
.operation-page #table-items .order-item h3 {
	margin: 6px 0;
	font-size: 1rem;
	line-height: 1.35;
}
.confirmed-item-actions {
	display: flex;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 6px 12px;
}
.confirmed-item-details {
	flex: 1 1 6rem;
	min-width: 0;
}
.confirmed-item-details[open] {
	flex-basis: 100%;
}
.confirmed-item-details summary {
	display: list-item;
	width: fit-content;
	min-width: 44px;
	min-height: 44px;
	padding: 12px 4px;
	color: var(--venue-surface-text, #211c18);
	font-size: 0.875rem;
	line-height: 20px;
	cursor: pointer;
}
.confirmed-item-details summary:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
.operation-page #table-items .confirmed-item-details p {
	margin: 4px 0;
	font-size: 0.875rem;
	line-height: 1.45;
}
.operation-page #table-items .confirmed-item-actions > button {
	margin: 0;
	min-height: 44px;
	padding: 10px 12px;
}
.operation-page #table-items .order-item .notes {
	color: var(--venue-panel-text, #211c18);
	background: var(--venue-panel, #fff9f0);
	padding: 8px 10px;
}

.operation-page .tools button:hover {
	color: var(--venue-surface-text, #211c18);
	background: var(--venue-surface-raised);
}

body.operation-page
	:where(
		.table-tabs,
		.table-scope,
		.handoff-filters,
		.cart-line,
		.role-navigation
	)
	button:hover:not([aria-pressed="true"]) {
	color: var(--venue-surface-text, #211c18);
	background: var(--venue-surface-raised);
}

body.operation-page .primary:hover:not(:disabled) {
	color: var(--brand-contrast, #fff);
	background: var(--brand, #6240bd);
}

.operation-page .operation-navigation {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
	gap: 10px;
}

.operation-page .operation-navigation button {
	min-width: 0;
	min-height: 64px;
	padding: 12px 16px;
	text-align: left;
	color: var(--venue-surface-text, #211c18);
	background: var(--venue-surface, #fffdf8);
	border: 1px solid var(--venue-line, #d8cdc0);
	border-radius: 12px;
}

.operation-page .operation-navigation button:hover:not([aria-current="page"]) {
	background: var(--venue-surface-raised);
}

.operation-page .operation-navigation button[aria-current="page"] {
	color: var(--brand-contrast, #fff);
	background: var(--brand, #6240bd);
	border-color: var(--brand, #6240bd);
}

.operation-page .role-navigation button {
	color: var(--venue-surface-text, #211c18);
}

.operation-page .role-navigation button span,
.operation-page .table-card:not(.review):not(.ready) .table-detail,
.operation-page .table-card:not(.review):not(.ready) .table-bottom,
.operation-page .cart :where(.cart-empty, .cart-footnote, .cart-line small),
.operation-page
	.menu-surface
	:where(.product-description, .product-preparation, .product-pricing-note) {
	color: var(--venue-muted, #675e56);
}

.operation-page .table-card:not(.review):not(.ready) .table-status {
	color: var(--venue-surface-text, #211c18);
	background: var(--venue-surface-raised);
}

body.operation-page .operation-navigation button[aria-current="page"],
body.operation-page .handoff-filters button[aria-pressed="true"],
body.operation-page .table-scope button[aria-pressed="true"] {
	color: var(--brand-contrast, #fff);
}

body.operation-page .table-tabs button[aria-pressed="true"] {
	color: var(--venue-text, #211c18);
	border-bottom-color: var(--brand, #6240bd);
}

.operation-page .table-tabs button:not([aria-pressed="true"]) {
	color: var(--venue-muted, #675e56);
}

.operation-page .cart-line button {
	color: var(--venue-surface-text, #211c18);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.operation-page #cart #send-order:disabled {
	opacity: 1;
	color: var(--venue-muted, #675e56);
	background: var(--venue-surface-raised);
	border-color: var(--venue-line, #d8cdc0);
}

body.operation-page #menu-panel :where(.category-bar, .section-bar) button,
body.operation-page #menu-panel .add-product:disabled {
	color: var(--venue-muted, #675e56);
	background: var(--venue-surface-raised);
	border: 1px solid var(--venue-line, #d8cdc0);
	opacity: 1;
}

body.operation-page #menu-panel .add-product:not(:disabled) {
	color: var(--brand-contrast, #fff);
	background: var(--brand, #6240bd);
	border-color: var(--brand, #6240bd);
}

body.operation-page
	#menu-panel
	:where(.category-bar, .section-bar)
	button[aria-pressed="true"] {
	color: var(--brand-contrast, #fff);
	background: var(--brand, #6240bd);
	border-color: var(--brand, #6240bd);
}

body.operation-page
	#menu-panel
	:where(.category-bar, .section-bar)
	button:hover:not([aria-pressed="true"]) {
	color: var(--venue-surface-text, #211c18);
	background: color-mix(
		in srgb,
		var(--venue-surface-raised) 82%,
		var(--venue-surface-text, #211c18)
	);
}

body.operation-page #menu-panel .add-product:hover:not(:disabled) {
	color: var(--brand-contrast, #fff);
	background: var(--brand, #6240bd);
}

body.operation-page
	#menu-panel
	:where(.category-bar, .section-bar)
	button[aria-pressed="true"]:hover {
	color: var(--brand-contrast, #fff);
	background: var(--brand, #6240bd);
}

.operation-page
	:where(
		.category-bar,
		.section-bar,
		.table-tabs,
		.table-scope,
		.handoff-filters,
		.operation-navigation
	)
	button:focus-visible,
.operation-page
	:where(.add-product, .cart button, .role-navigation button):focus-visible {
	outline: 3px solid var(--venue-surface-text, #211c18);
	outline-offset: 3px;
}

.operation-page .table-scope button:not([aria-pressed="true"]),
.operation-page .handoff-filters button:not([aria-pressed="true"]) {
	color: var(--venue-text, #211c18);
}

.operation-page .operation-navigation button:not([aria-current="page"]) {
	color: var(--venue-surface-text, #211c18);
}

.operation-page .table-follow[aria-pressed="true"],
.operation-page .table-owner-label {
	color: var(--venue-surface-text, #211c18);
}

/* The product dialog is a light panel even when the surrounding venue is dark. */
.operation-page #product-dialog {
	--venue-surface-text: var(--venue-panel-text, #211c18);
	--muted: var(--venue-panel-muted, #665d56);
	--surface: var(--venue-panel, #fff9f0);
	--ink: var(--venue-panel-text, #211c18);
	--line: color-mix(
		in srgb,
		var(--venue-panel-text, #211c18) 28%,
		var(--venue-panel, #fff9f0)
	);
	color: var(--venue-panel-text, #211c18);
}

.operation-page
	#product-dialog
	:where(
		.muted,
		.modifier-rule,
		.modifier-line,
		.product-pricing-note,
		.scale-heading div,
		.scale-status,
		.scale-values dt
	) {
	color: var(--venue-panel-muted, #665d56);
}

.operation-page #product-dialog .scale-capture {
	color: var(--venue-panel-text, #211c18);
	background: var(--operation-panel-raised);
}

.operation-page
	#product-dialog
	:where(.scale-values div, .scale-device-settings, .modifier-option) {
	color: var(--venue-panel-text, #211c18);
	background: var(--venue-panel, #fff9f0);
}

.operation-page #product-dialog .modifier-option:has(input:checked) {
	color: var(--venue-panel-text, #211c18);
	background: color-mix(
		in srgb,
		var(--venue-panel, #fff9f0) 86%,
		var(--brand, #6240bd)
	);
}

.operation-page
	#product-dialog
	:where(
		.scale-status[data-state="stable"],
		.scale-status[data-state="unstable"],
		.scale-status[data-state="error"]
	) {
	color: var(--venue-panel-text, #211c18);
}

.operation-page #product-dialog form > :not(.product-dialog-media) {
	width: calc(100% - 52px);
	max-width: calc(100% - 52px);
}

.operation-page #product-dialog :where(input, select, textarea) {
	max-width: 100%;
}

.operation-page
	#product-dialog
	:where(button, input, select, textarea):focus-visible {
	outline: 3px solid var(--venue-panel-text, #211c18);
	outline-offset: 2px;
}

/* The cart can sit beside the catalog only while both columns remain readable. */
@media (max-width: 1150px) {
	.operation-page .table-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.operation-page .cart {
		position: static;
	}
}

@media (max-width: 1000px) {
	.operation-page .product-row.no-photo {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.operation-page .product-row.no-photo .add-product {
		grid-column: 2;
	}
}

@media (max-width: 760px) {
	.operation-page #product-dialog form > :not(.product-dialog-media) {
		width: calc(100% - 40px);
		max-width: calc(100% - 40px);
	}

	.operation-page #table-view .page-heading h1 {
		font-size: clamp(1.9rem, 8vw, 3rem);
		line-height: 1.08;
	}

	.operation-page .product-row.no-photo {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}

@media (max-width: 640px) {
	.operation-page #table-view .page-heading {
		align-items: flex-start;
		flex-direction: column;
		gap: 10px;
	}

	.operation-page .table-balance {
		text-align: left;
	}

	.operation-page .table-tabs {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.operation-page .table-tabs button {
		min-width: 0;
	}
}

@media (max-width: 420px) {
	.operation-page .app-header .brand {
		font-size: 1.2rem;
	}

	.operation-page .app-header .header-link {
		padding-inline: 10px;
	}

	.operation-page .menu-surface {
		padding: 16px;
	}

	.operation-page .category-bar,
	.operation-page .section-bar {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.operation-page :where(.category-bar, .section-bar) button {
		min-width: 0;
		padding-inline: 10px;
	}

	.operation-page .operation-navigation {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.operation-page .operation-navigation button {
		min-height: 72px;
		padding: 10px 12px;
	}

	.operation-page .product-row,
	.operation-page .product-row.no-photo {
		gap: 10px 12px;
		padding-block: 18px;
	}

	.operation-page .product-row.has-photo {
		grid-template-columns: 76px minmax(0, 1fr);
	}

	.operation-page .product-row.no-photo {
		grid-template-columns: minmax(0, 1fr);
	}

	.operation-page .product-image {
		width: 76px;
		height: 76px;
		grid-row: auto;
	}

	.operation-page .product-row .add-product,
	.operation-page .product-row.no-photo .add-product {
		grid-column: 1 / -1;
		justify-self: stretch;
		width: 100%;
		min-height: 48px;
	}

	.operation-page .product-info h4 {
		font-size: 1.16rem;
		line-height: 1.24;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.operation-page .product-row .add-product,
	.operation-page
		:where(.category-bar, .section-bar, .operation-navigation)
		button {
		transition: transform 160ms ease-out;
	}

	.operation-page .product-row .add-product:active,
	.operation-page
		:where(.category-bar, .section-bar, .operation-navigation)
		button:active {
		transform: scale(0.98);
	}
}
