/**
 * Staging-only presentation bridge for Woo account and TVC workbench views.
 * Loaded after the plugin styles; no routes, permissions, form semantics or
 * JavaScript state are changed here.
 */
body:is(.tvc-account-context, .tvc-account-access-page, .tvc-workbench-access-page, .tvc-studio-context) {
	--torrelles-private-ink: var(--brand-ink);
	--torrelles-private-ink-soft: #121817;
	--torrelles-private-paper: var(--brand-paper);
	--torrelles-private-surface: #ffffff;
	--torrelles-private-muted: #606661;
	--torrelles-private-line: #c8cbc7;
	--torrelles-private-line-strong: #242925;
	--torrelles-private-teal: var(--brand-green);
	--torrelles-private-teal-dark: var(--brand-green-strong);
	--torrelles-private-teal-soft: var(--brand-green-soft);
	--torrelles-private-coral: var(--brand-accent);
	--torrelles-private-content: 1180px;
	--torrelles-private-workbench: 1440px;
	--torrelles-private-sticky-top: calc(var(--wp-admin--admin-bar--height, 0px) + 16px);
	--tvc-color-canvas: var(--torrelles-private-paper);
	--tvc-color-surface: var(--torrelles-private-surface);
	--tvc-color-ink: var(--torrelles-private-ink);
	--tvc-color-muted: var(--torrelles-private-muted);
	--tvc-color-line: var(--torrelles-private-line);
	--tvc-color-line-strong: var(--torrelles-private-line-strong);
	--tvc-color-accent: var(--torrelles-private-teal);
	--tvc-color-accent-hover: var(--torrelles-private-teal-dark);
	--tvc-color-accent-soft: var(--torrelles-private-teal-soft);
	--tvc-color-focus: var(--brand-focus);
	--tvc-content-width: var(--torrelles-private-content);
	min-width: 320px;
	background: var(--torrelles-private-paper);
	color: var(--torrelles-private-ink);
	font-family: var(--tvc-font-sans, "TVC DM Sans", "DM Sans", "Avenir Next", Avenir, Arial, sans-serif);
	line-height: var(--brand-line-height-body);
}

body.torrelles-operational-chrome:is(.tvc-account-context, .tvc-studio-context) {
	--torrelles-private-sticky-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--torrelles-chrome-header, 76px) + 16px);
}

body:is(.tvc-account-context, .tvc-studio-context) #wrapper {
	display: flex; min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px)); flex-direction: column;
}
body:is(.tvc-account-context, .tvc-studio-context) #wrapper > #main { width: 100%; flex: 1 0 auto; background: var(--torrelles-private-paper); }
body:is(.tvc-account-context, .tvc-studio-context) #wrapper > .fusion-footer { flex: 0 0 auto; margin-top: auto; }
body.tvc-account-context #main > .fusion-row,
body.tvc-account-context .post-content > .woocommerce {
	box-sizing: border-box; width: min(100%, var(--torrelles-private-content)); max-width: var(--torrelles-private-content) !important; margin-inline: auto;
}
body.tvc-workbench-account #main > .fusion-row { max-width: var(--torrelles-private-workbench) !important; }

/* Dividers and color carry hierarchy; elevation is deliberately absent. */
body.tvc-account-context .woocommerce *, body.tvc-account-context .woocommerce *::before, body.tvc-account-context .woocommerce *::after,
body.tvc-studio-context .tvc-workbench *, body.tvc-studio-context .tvc-workbench *::before, body.tvc-studio-context .tvc-workbench *::after {
	box-shadow: none !important; text-shadow: none !important;
}
body:is(.tvc-account-context, .tvc-studio-context) :is(a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
	outline: 3px solid var(--brand-focus) !important; outline-offset: 3px !important;
}
body:is(.tvc-account-context, .tvc-studio-context) :is(button, input, select, textarea) { font: inherit; }
body:is(.tvc-account-context, .tvc-studio-context) :is(button, .button, input, select) { min-height: 44px; }

/* Project-first access and password login. */
body.tvc-workbench-access-page .tvc-workbench--access { box-sizing: border-box; }
body.tvc-account-access-page #main { padding: clamp(44px, 6vw, 88px) clamp(16px, 4vw, 40px) clamp(60px, 8vw, 112px); }
body.tvc-account-access-page .post-content > .woocommerce { width: min(100%, 920px); max-width: 920px !important; }
body.tvc-account-access-page .tvc-account-access,
body.tvc-account-access-page .woocommerce-form-login {
	box-sizing: border-box; margin: 0; border: 1px solid var(--torrelles-private-line-strong); border-radius: 0; background: var(--torrelles-private-surface);
}
body.tvc-account-access-page .tvc-account-access { padding: clamp(30px, 5vw, 56px); border-top: 5px solid var(--torrelles-private-teal); }
body.tvc-account-access-page .tvc-account-access h1 {
	margin: 10px 0 16px; font-size: clamp(2.35rem, 5vw, 4rem); font-weight: 620; letter-spacing: -0.06em; line-height: var(--brand-line-height-display) !important;
}
body.tvc-account-access-page .tvc-account-access__eyebrow { color: var(--torrelles-private-teal-dark); font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
body.tvc-account-access-page .tvc-account-access > p:not(.tvc-account-access__eyebrow) { max-width: 610px; color: var(--torrelles-private-muted); line-height: 1.58; }
body.tvc-account-access-page .tvc-account-access__form { display: grid; gap: 9px; margin-top: 28px; }
body.tvc-account-access-page .tvc-account-access__controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
body.tvc-account-access-page .tvc-account-access__controls input { min-width: 0; min-height: 52px; border: 1px solid var(--torrelles-private-line-strong); border-right: 0; border-radius: 0; }
body.tvc-account-access-page :is(.tvc-account-access__controls .button, .woocommerce-form-login .button) {
	min-height: 52px; padding: 12px 22px; border: 1px solid var(--torrelles-private-ink); border-radius: 0; background: var(--torrelles-private-teal); color: var(--torrelles-private-ink); font-weight: 780;
}
body.tvc-account-access-page :is(.tvc-account-access__controls .button, .woocommerce-form-login .button):is(:hover, :focus-visible) { background: var(--torrelles-private-ink); color: var(--torrelles-private-paper); }
body.tvc-account-access-page .tvc-account-access__notice { margin-top: 22px; padding: 14px 16px; border: 1px solid var(--torrelles-private-teal-dark); border-left: 4px solid var(--torrelles-private-teal); background: var(--torrelles-private-teal-soft); }
body.tvc-account-access-page .tvc-account-access__notice--error { border-color: #b42318; background: #fff0ed; }
body.tvc-account-access-page .woocommerce-form-login { padding: clamp(26px, 4vw, 42px); }

/* Scope the shared reading rhythm to prose and real controls, not icon glyphs. */
body:is(.tvc-account-context, .tvc-account-access-page, .tvc-workbench-access-page, .tvc-studio-context) :is(.woocommerce p, .tvc-workbench p, .tvc-briefing p) {
	line-height: var(--brand-line-height-body);
}
body:is(.tvc-account-context, .tvc-account-access-page, .tvc-workbench-access-page, .tvc-studio-context) :is(button, input, select, label, .button) {
	line-height: var(--brand-line-height-ui);
}
body:is(.tvc-workbench-account, .tvc-workbench-access-page, .tvc-studio-context) .tvc-workbench :is(.tvc-access-request h1, .buyer-page-title h1, .buyer-project__header h1),
body.tvc-account-context .tvc-briefing h2 {
	line-height: var(--brand-line-height-display) !important;
}
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench .unclassified-link strong { color: var(--brand-on-accent); }
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench .tag--coral {
	border-color: var(--brand-accent);
	background: var(--brand-accent-soft);
	color: var(--brand-accent-strong);
}
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench :is(.next-step-banner, .buyer-next-action) {
	--coral: var(--brand-ink);
}
body.tvc-account-context .tvc-briefing__eyebrow { color: var(--brand-accent-strong); }
body.tvc-account-context :is(.tvc-briefing__notes, .tvc-briefing__file, .tvc-briefing__submit, .tvc-briefing__cta, .tvc-briefing__remove input):focus-visible {
	outline-color: var(--brand-focus);
}

/* Authenticated My Account. */
body.tvc-commerce-account:not(.tvc-account-access-page):not(.tvc-workbench-account) #main { padding: clamp(44px, 5vw, 76px) clamp(18px, 4vw, 40px) clamp(64px, 7vw, 104px); }
body.tvc-commerce-account:not(.tvc-account-access-page):not(.tvc-workbench-account) .woocommerce { grid-template-columns: 236px minmax(0, 1fr); gap: clamp(30px, 4vw, 60px); }
body.tvc-commerce-account .woocommerce-MyAccount-navigation {
	position: sticky; top: var(--torrelles-private-sticky-top); width: 100%; margin: 0; align-self: start;
}
body.tvc-commerce-account .woocommerce-MyAccount-navigation ul { margin: 0; padding: 0; border: 1px solid var(--torrelles-private-line-strong); border-radius: 0; background: var(--torrelles-private-surface); }
body.tvc-commerce-account .woocommerce-MyAccount-navigation li { margin: 0; border-bottom: 1px solid var(--torrelles-private-line); }
body.tvc-commerce-account .woocommerce-MyAccount-navigation li:last-child { border-bottom: 0; }
body.tvc-commerce-account .woocommerce-MyAccount-navigation a { min-height: 52px; padding: 10px 15px; border-left: 4px solid transparent; color: var(--torrelles-private-ink); font-weight: 680; }
body.tvc-commerce-account .woocommerce-MyAccount-navigation :is(li.is-active a, a:hover) { padding-left: 15px; border-left-color: var(--torrelles-private-teal); background: var(--torrelles-private-teal-soft); }
body.tvc-commerce-account .woocommerce-MyAccount-content { box-sizing: border-box; min-width: 0; max-width: 920px; margin: 0; }
body.tvc-commerce-account .woocommerce-MyAccount-content :is(form, table.shop_table, table.my_account_orders, .tvc-order-context) { border-radius: 0; box-shadow: none !important; }
body.tvc-commerce-account .woocommerce-MyAccount-content :is(table.shop_table, table.my_account_orders) { width: 100%; border: 1px solid var(--torrelles-private-line-strong); border-collapse: collapse; background: var(--torrelles-private-surface); }
body.tvc-commerce-account .woocommerce-MyAccount-content :is(table.shop_table, table.my_account_orders) :is(th, td) { border: 0; border-bottom: 1px solid var(--torrelles-private-line); }
body.tvc-commerce-view-order .tvc-order-context { border-top: 5px solid var(--torrelles-private-teal); background: var(--torrelles-private-surface); }

/* Customer project list/detail and provider Studio share the native workbench. */
body:is(.tvc-workbench-account, .tvc-workbench-access-page, .tvc-studio-context) .tvc-workbench {
	--ink: var(--torrelles-private-ink); --ink-soft: var(--torrelles-private-ink-soft); --paper: var(--torrelles-private-paper); --surface: var(--torrelles-private-surface);
	--muted: var(--torrelles-private-muted); --line: var(--torrelles-private-line); --line-strong: var(--torrelles-private-line-strong);
	--accent: var(--torrelles-private-teal); --accent-hover: var(--torrelles-private-teal-dark); --accent-soft: var(--torrelles-private-teal-soft); --coral: var(--torrelles-private-coral); --content-max: var(--torrelles-private-workbench);
	width: 100%; max-width: var(--torrelles-private-workbench); margin-inline: auto; background: var(--torrelles-private-paper); font-family: inherit;
}
body.tvc-workbench-account #main { padding: clamp(24px, 3vw, 44px) clamp(14px, 3vw, 32px) clamp(52px, 6vw, 84px); }
body.tvc-workbench-account .woocommerce-MyAccount-content { max-width: none; }
body.tvc-workbench-account .tvc-workbench .buyer-home { width: min(calc(100% - 48px), 1260px); margin-inline: auto; }
body.tvc-workbench-account .tvc-workbench .buyer-project { width: min(100%, var(--torrelles-private-workbench)); margin-inline: auto; border-color: var(--torrelles-private-line); }
body.tvc-workbench-account .tvc-workbench :is(.buyer-project-table, .buyer-project__header, .buyer-next-action, .tabs--buyer, .buyer-project__main, .buyer-delivery-rail > section, .latest-message, .delivery-card) { border-color: var(--torrelles-private-line); border-radius: 0; }
body.tvc-workbench-account .tvc-workbench :is(.next-step-banner, .buyer-next-action) { background: var(--torrelles-private-teal); }

body.tvc-studio-context .tvc-workbench--provider {
	position: relative; left: auto; width: min(calc(100% - clamp(24px, 4vw, 64px)), var(--torrelles-private-workbench)); max-width: var(--torrelles-private-workbench); margin: clamp(24px, 3vw, 48px) auto clamp(48px, 6vw, 88px);
}
body.tvc-studio-context .tvc-workbench .workbench--provider {
	width: 100%; max-width: var(--torrelles-private-workbench); margin-inline: auto; grid-template-columns: 305px minmax(0, 1fr) 282px; border: 1px solid var(--torrelles-private-line-strong);
}
body.tvc-studio-context .tvc-workbench .project-inbox,
body.tvc-studio-context .tvc-workbench .action-rail { border-color: var(--torrelles-private-line); background: var(--torrelles-private-paper); }
body.tvc-studio-context .tvc-workbench :is(.project-row.is-selected, .filter-list button.is-active) { background: var(--torrelles-private-teal-soft); }
body.tvc-studio-context .tvc-workbench :is(.project-row.is-selected::before, .tabs button.is-active::after) { background: var(--torrelles-private-teal); }

@media (min-width: 1180px) {
	body.tvc-studio-context .tvc-workbench .project-inbox,
	body.tvc-studio-context .tvc-workbench .action-rail,
	body.tvc-workbench-account .tvc-workbench .buyer-delivery-rail {
		position: sticky; top: var(--torrelles-private-sticky-top); max-height: calc(100dvh - var(--torrelles-private-sticky-top) - 16px); align-self: start; overflow-y: auto;
	}
}

/* File and audio affordances stay native and keyboard reachable. */
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench :is(.file-row, .file-row-actions, .file-attachment, .delivery-card__asset) { min-width: 0; border-color: var(--torrelles-private-line); border-radius: 0; }
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench .file-row:is(:hover, :focus-within) { background: var(--torrelles-private-teal-soft); }
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench .upload-field { border: 1px dashed var(--torrelles-private-line-strong); border-radius: 0; background: var(--torrelles-private-surface); }
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench .upload-field:is(:hover, :focus-within, .is-dragging, [data-state="dragging"]) { border-color: var(--torrelles-private-teal-dark); background: var(--torrelles-private-teal-soft); outline: 2px solid var(--brand-focus); outline-offset: 2px; }
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench input[type="file"]::file-selector-button { min-height: 40px; margin-right: 12px; padding: 9px 14px; border: 1px solid var(--torrelles-private-ink); border-radius: 0; background: var(--torrelles-private-teal); font: inherit; cursor: pointer; }
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench :is(audio, .tvc-audio, .tvc-audio--attachment) { display: block; width: 100%; max-width: 100%; accent-color: var(--torrelles-private-teal); color-scheme: light; }
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench .audio-player__play,
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench .audio-player__track span { background: var(--torrelles-private-teal); }
body:is(.tvc-workbench-account, .tvc-studio-context) .tvc-workbench .audio-player__track { background: var(--torrelles-private-line); }

@media (max-width: 1179px) {
	body.tvc-studio-context .tvc-workbench--provider { left: auto; width: min(calc(100% - 32px), var(--torrelles-private-workbench)); margin-inline: auto; }
	body.tvc-studio-context .tvc-workbench .workbench--provider { grid-template-columns: 270px minmax(0, 1fr); }
}
@media (max-width: 1023px) {
	body.tvc-commerce-account:not(.tvc-account-access-page):not(.tvc-workbench-account) .woocommerce { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	body.tvc-commerce-account .woocommerce-MyAccount-navigation { position: relative; top: auto; overflow: hidden; }
	body.tvc-commerce-account .woocommerce-MyAccount-navigation ul { display: flex; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
	body.tvc-commerce-account .woocommerce-MyAccount-navigation ul::-webkit-scrollbar { display: none; }
	body.tvc-commerce-account .woocommerce-MyAccount-navigation li { flex: 0 0 auto; border-right: 1px solid var(--torrelles-private-line); border-bottom: 0; }
	body.tvc-commerce-account .woocommerce-MyAccount-navigation a { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
	body.tvc-commerce-account .woocommerce-MyAccount-navigation :is(li.is-active a, a:hover) { border-bottom-color: var(--torrelles-private-teal); }
	body.tvc-studio-context .tvc-workbench--provider { left: auto; width: min(calc(100% - 24px), var(--torrelles-private-workbench)); margin-inline: auto; }
}
@media (max-width: 760px) {
	body.tvc-account-access-page #main { padding: 28px 14px 56px; }
	body.tvc-account-access-page .tvc-account-access, body.tvc-account-access-page .woocommerce-form-login { padding: 26px 20px; }
	body.tvc-workbench-account #main { padding: 16px 0 0; }
	body.tvc-workbench-account .tvc-workbench, body.tvc-workbench-account .tvc-workbench .buyer-home { width: 100%; margin-inline: 0; }
	body.tvc-workbench-account .tvc-workbench .buyer-project { border-inline: 0; }
	body.tvc-studio-context .tvc-workbench--provider { width: 100%; margin: 0; }
	body.tvc-studio-context .tvc-workbench .workbench--provider { border-inline: 0; }
}
@media (max-width: 640px) {
	body.tvc-account-access-page .tvc-account-access__controls { grid-template-columns: minmax(0, 1fr); gap: 10px; }
	body.tvc-account-access-page .tvc-account-access__controls input { border-right: 1px solid var(--torrelles-private-line-strong); }
	body.tvc-account-access-page .tvc-account-access__controls .button { width: 100%; }
	body.tvc-has-mobile-project-nav { --torrelles-private-mobile-clearance: calc(68px + env(safe-area-inset-bottom)); }
	body.tvc-has-mobile-project-nav .tvc-workbench--customer { padding-bottom: var(--torrelles-private-mobile-clearance); }
	body.tvc-has-mobile-project-nav :is(#wrapper > .fusion-footer, .public-site-footer) { margin-bottom: var(--torrelles-private-mobile-clearance, calc(68px + env(safe-area-inset-bottom))); }
	body.tvc-workbench-account .tvc-workbench .customer-bottom-nav { position: fixed; z-index: 100; right: 0; bottom: 0; left: 0; border-top: 1px solid var(--torrelles-private-line-strong); background: var(--torrelles-private-paper); backdrop-filter: none; }
	body.tvc-studio-context .tvc-workbench .action-rail { width: min(360px, 94vw); padding-bottom: env(safe-area-inset-bottom); background: var(--torrelles-private-paper); }
}

@media (prefers-reduced-motion: reduce) {
	body:is(.tvc-account-context, .tvc-studio-context) *, body:is(.tvc-account-context, .tvc-studio-context) *::before, body:is(.tvc-account-context, .tvc-studio-context) *::after {
		scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
	}
}
@media (forced-colors: active) {
	body:is(.tvc-account-context, .tvc-studio-context) :is(a, button, input, select, textarea):focus-visible { outline-color: Highlight !important; }
	body:is(.tvc-account-context, .tvc-studio-context) :is(.woocommerce-MyAccount-navigation ul, .tvc-account-access, .woocommerce-form-login, .buyer-project, .workbench--provider, .file-row, .upload-field) { border-color: CanvasText !important; }
}
