/* Guest Cards workspace shell — Ventura / Wedding Cards UG.
   Interface only. The live canvas, print/export rendering, card artwork, QR codes, data and every control's
   behaviour are untouched; the official lockup and Ventura faces are unchanged.
   Quiet warm neutrals; burgundy stays for primary actions. No decorative motion. */

/* ---------- palette: quiet warm neutrals ---------- */
:root {
  --bg-app: #f5f3ee;
  --bg-subtle: #f9f7f3;
  --bg-hover: #eeebe4;
  --bg-stage: #e8e4dc;
  --border-color: #e0dbd1;
  --border-soft: #ebe7df;
  --text-muted: #5d5750;
  --shell-radius: 16px;
  --shell-radius-inner: 10px;
}
html[data-theme="dark"] {
  --bg-app: #161513;
  --bg-surface: #201e1b;
  --bg-subtle: #282521;
  --bg-hover: #312d28;
  --bg-stage: #100f0d;
  --border-color: #3a3631;
  --border-soft: #2f2c27;
  --border-strong: #6b645b;
  --text-main: #f3f0ea;
  --text-secondary: #ddd8cf;
  --text-muted: #b4ada3;
}
/* Dark: earlier rules hard-coded navy surfaces; they follow the warm tokens so panels match the shell. */
html[data-theme="dark"] :is(.card-section, .staff-assignment-panel, .bespoke-request-card, .client-link-inner) { background: var(--bg-surface); }
html[data-theme="dark"] :is(.field-group-card, .disclosure-group, .journey-seg-btn:hover, .journey-seg-btn.active, .pricing-category-banner, .staff-permissions-box, .brief-preview-notes, .upload-zone, .local-simulation-callout, .staff-template-catalog-box, .client-link-why, .client-link-btn, .guest-link-status) { background: var(--bg-subtle); }
html[data-theme="dark"] :is(.client-link-inner, .client-link-btn, .guest-link-status) { border-color: var(--border-color); }
html[data-theme="dark"] .header-mode-row { background: transparent; }
html[data-theme="dark"] .guest-table tr { background: var(--bg-subtle); border-color: var(--border-color); }
html[data-theme="dark"] .guest-table tr.active-preview-row { background: linear-gradient(rgba(232, 166, 187, 0.16), rgba(232, 166, 187, 0.16)), var(--bg-subtle); }
html[data-theme="dark"] .guest-table tr.row-invalid { background: linear-gradient(rgba(190, 60, 90, 0.22), rgba(190, 60, 90, 0.22)), var(--bg-subtle); }
body { background: var(--bg-app); }
::selection { background: color-mix(in srgb, var(--accent-primary) 22%, transparent); }
html { scrollbar-color: var(--border-strong) transparent; }
input, textarea { caret-color: var(--accent-primary); }
.app-header { background: var(--bg-app); }

/* ---------- header: monogram · Design / Guests / Download · More · next step (one row everywhere) ----------
   The project title is not repeated here; it lives once, in the editable Project row above the guest picker. */
.app-header .header-top-row,
.app-header .header-nav-cluster,
.app-header .header-mode-row { display: contents; }
.app-header .header-card {
  display: grid; align-items: center; column-gap: 12px; row-gap: 0;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "brand steps more cta" "font font font font";
  padding: 6px 12px; border-radius: var(--shell-radius); overflow: visible;
}
.app-header .brand-group { grid-area: brand; padding: 0; }
/* The stages sit centred in the freed space, so there is no empty column beside them. */
.app-header .step-tabs { grid-area: steps; min-width: 0; justify-self: center; }
.app-header .header-more { grid-area: more; position: relative; justify-self: end; }
.app-header #headerNextStepBtn { grid-area: cta; }
/* Font safeguard: its own row, so it takes no room (and adds no column gap) while the Ventura faces load;
   a real failure shows a short visible warning under the bar. */
.app-header .font-status-pill { grid-area: font; justify-self: start; min-width: 0; max-width: 100%; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-header .font-status-pill.is-ok, .app-header .font-status-pill:empty { display: none; }

/* Home: the approved monogram alone, white with no box in dark mode (see the existing .wcu-logo-mark rule). */
.app-header .brand-home-btn { min-width: 44px; min-height: 44px; padding: 4px 6px; }
.app-header .brand-monogram { display: block; height: 30px; width: auto; aspect-ratio: 264.49 / 181.64; }

.app-header .step-badge { white-space: nowrap; }

/* Help names the full product under its title (the header shows the monogram alone). */
.help-product-name { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* More: a quiet icon-only ellipsis (named "More options") and a dropdown panel.
   Transparent at rest, a soft fill on hover, the accent fill while open, a 3px ring on keyboard focus.
   A fixed 44×44 box at every width, so it never grows into a filled pill. */
.header-more-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none; align-self: center;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; margin: 0;
  border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text-muted);
  font: inherit; line-height: 0; cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
/* Solid dots: the shared .ui-icon rule (fill: none; stroke) would otherwise draw hollow rings. */
.header-more-btn .header-more-icon { display: block; width: 22px; height: 22px; pointer-events: none; fill: currentColor; stroke: none; }
.header-more-btn:hover { background: var(--bg-hover); border-color: var(--border-color); color: var(--text-main); }
.header-more-btn[aria-expanded="true"],
.header-more-btn[aria-expanded="true"]:hover { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }
.header-more-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.header-more-btn:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: reduce) { .header-more-btn { transition: none; } }
html[data-motion="off"] .header-more-btn { transition: none; }
.header-more-panel {
  position: absolute; z-index: 60; top: calc(100% + 8px); right: 0; width: min(320px, calc(100vw - 16px));
  display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px;
  background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--shell-radius); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}
.header-more-panel[hidden] { display: none; }
.header-more-panel .mode-switcher-pills { display: flex !important; flex-direction: column; align-items: stretch; gap: 10px; width: auto; margin: 0; padding: 0; border: 0; }
.header-more-panel .mode-switcher-pills > * { width: 100%; flex: none; }
.header-more-panel .help-btn { justify-content: flex-start; min-height: 44px; }
/* Inside More, Help and Appearance always show their words (an older phone rule made Help icon-only). */
.app-header .header-more-panel .help-btn > span { display: inline; position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: nowrap; }
.header-more-panel .theme-menu-wrap { width: 100%; }
.header-more-panel .theme-menu-btn { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 44px; padding: 0 14px; border-radius: 999px; }
/* Visible word only; the accessible name stays the button's own aria-label ("Appearance: Light/Dark/Auto"). */
.header-more-panel .theme-menu-btn::after { content: "Appearance"; font-weight: 700; font-size: 14px; color: var(--text-main); }
/* While choosing, the button hides and the Light / Dark / Auto switch fills the panel width. */
.header-more-panel .theme-menu-btn[hidden] { display: none; }
.header-more-panel .theme-menu:not([hidden]) { display: flex; width: 100%; }
.header-more-panel .mode-segmented-track { display: grid; grid-template-columns: 1fr 1fr; }
.header-more-panel .header-invitations-link {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--shell-radius-inner);
  border: 1px solid var(--border-color); background: var(--bg-subtle); color: var(--accent-text); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.header-more-panel .header-invitations-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Stage names read Design · Guests · Download everywhere; the full step name stays the accessible name. */
.app-header .step-tab .step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app-header .step-tab .step-label-short, .app-header .step-tab.active .step-label-short { display: inline; white-space: nowrap; }
/* ---------- tablet: the same single row ---------- */
@media (min-width: 601px) and (max-width: 1080px) {
  .app-header { padding: 8px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
}

/* ---------- phones: monogram · three labelled steps · More (a font warning, if any, takes a second row) ---------- */
@media (max-width: 600px) {
  .app-header { position: static; padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); }
  .app-header .header-card { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand steps more" "font font font"; column-gap: 6px; padding: 4px 8px; }
  .app-header .brand-home-btn { padding-inline: 2px; }
  .app-header #headerNextStepBtn { display: none; }
  .header-more-panel { width: min(320px, calc(100vw - 24px)); }
}

/* ---------- workspace ---------- */
.workspace-grid { padding-bottom: max(96px, calc(40px + env(safe-area-inset-bottom, 0px))); }
.preview-card-sticky { border-radius: var(--shell-radius); }
.canvas-stage-wrapper { background-color: var(--bg-stage); }
.card-section, .export-box { border-radius: var(--shell-radius); }
.card-section .btn, .export-box .btn { border-radius: var(--shell-radius-inner); }

/* Guest link: a compact card inside the workspace, at the top of the guest list and download settings it belongs to. */
.workspace-grid > #simClientBanner { position: static; min-width: 0; margin: 0; padding: 0; background: transparent; border: 0; box-shadow: none; }
.workspace-grid > #simClientBanner .client-link-inner {
  max-width: none; margin: 0; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--shell-radius);
}
.workspace-grid > #simClientBanner .guest-link-row { flex: 1 1 260px; min-width: 0; }
.workspace-grid > #simClientBanner .guest-link-field { min-width: 0; }
.workspace-grid > #simClientBanner .client-link-feedback:empty { display: none; }
/* Wide screens: the card heads the controls column, beside the live card; one slim line for Guests. */
@media (min-width: 1081px) {
  .workspace-grid:is([data-step="client"], [data-step="export"]) > #simClientBanner { grid-column: 1; grid-row: 1; }
  .workspace-grid:is([data-step="client"], [data-step="export"]) > .controls-column { grid-column: 1; grid-row: 2; }
  .workspace-grid:is([data-step="client"], [data-step="export"]) > .preview-column { grid-column: 2; grid-row: 1 / span 2; }
  .workspace-grid:is([data-step="client"], [data-step="export"]) { row-gap: 16px; }
  .workspace-grid > #simClientBanner .client-link-inner { flex-wrap: nowrap; padding: 8px 12px; }
  .workspace-grid > #simClientBanner .guest-link-head { flex: none; }
  .workspace-grid > #simClientBanner #shortenLinkHint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .workspace-grid[data-step="export"] > #simClientBanner .client-link-inner { flex-wrap: wrap; }
}

/* Design (wide): rail · centred canvas · active inspector. A tool switch only swaps the inspector. */
@media (min-width: 1280px) {
  .workspace-grid[data-step="staff"] { grid-template-columns: 84px minmax(0, 1fr) minmax(360px, 400px); }
  .workspace-grid[data-step="staff"][data-rail="compact"] { grid-template-columns: 60px minmax(0, 1fr) minmax(360px, 400px); }
  .workspace-grid[data-rail="compact"] .tool-rail .rail-btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .workspace-grid[data-rail="compact"] .tool-rail .rail-btn { min-height: 48px; padding-inline: 0; }
  /* The inspector column keeps one height whichever tool is open, so the canvas never shifts. */
  .workspace-grid[data-step="staff"] .studio-sections { align-self: start; }
}
.rail-collapse-btn {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 8px auto 0; padding: 0;
  border: 1px solid var(--border-color); border-radius: var(--shell-radius-inner); background: var(--bg-surface); color: var(--text-muted); cursor: pointer;
}
.rail-collapse-btn:hover { color: var(--text-main); background: var(--bg-hover); }
.rail-collapse-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.workspace-grid[data-rail="compact"] .rail-collapse-btn svg { transform: scaleX(-1); }
@media (min-width: 1280px) { .workspace-grid[data-step="staff"] .rail-collapse-btn { display: inline-flex; } }

/* Wide screens: the preview card gives the artwork the room. Guest picker on top; zoom and guides share a row;
   details and quick downloads share the footer. The canvas is sized from what is left (see updatePreviewCanvasBudget). */
@media (min-width: 1081px) {
  .preview-card-sticky { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ptitle ptitle" "guest guest" "zoom tools" "stage stage" "hint hint" "diag actions"; }
  .preview-card-sticky > .project-title-row { grid-area: ptitle; }
  .preview-card-sticky > .preview-guest-bar { grid-area: guest; }
  .preview-card-sticky > .preview-zoom-bar { grid-area: zoom; border-bottom: 1px solid var(--border-color); }
  .preview-card-sticky > .preview-toolbar { grid-area: tools; border-bottom: 1px solid var(--border-color); }
  .preview-card-sticky > .canvas-stage-wrapper { grid-area: stage; }
  .preview-card-sticky > .canvas-drag-hint { grid-area: hint; }
  .preview-card-sticky > .preview-diagnostics { grid-area: diag; align-self: stretch; }
  .preview-card-sticky > .preview-quick-actions { grid-area: actions; align-self: stretch; align-content: center; }
  /* The column is already labelled "Live personalised invitation card preview"; the header carries the brand mark. */
  .preview-toolbar-left strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .preview-toolbar-left .preview-wcu-icon { display: none; }
  .preview-card-sticky > .preview-zoom-bar { flex-wrap: nowrap; gap: 8px; }
}
/* Below 1500px the card details need the full width to stay readable; downloads follow on their own row. */
@media (min-width: 1081px) and (max-width: 1499px) {
  .preview-card-sticky { grid-template-areas: "ptitle ptitle" "guest guest" "zoom tools" "stage stage" "hint hint" "diag diag" "actions actions"; }
}
/* Tablets: the stacked preview grows with the screen up to 600px, leaving the controls close below. */
@media (min-width: 601px) and (max-width: 1080px) {
  #invitationCanvas { max-height: clamp(320px, calc(100svh - 240px), 600px); }
}
/* Dragging names applies to Design only. */
.workspace-grid:not([data-step="staff"]) .canvas-drag-hint { display: none; }
@media (max-width: 600px) {
  /* Phones: the two quick downloads sit side by side. */
  .preview-quick-actions { grid-template-columns: 1fr 1fr; }
}

/* Tool rail: obvious selected state with a consistent stroke. */
.tool-rail .rail-btn.active { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-border); }
.tool-rail .rail-btn .ui-icon { stroke-width: 1.8; }

/* Download (wide): settings beside a generous, centred card. */
@media (min-width: 1081px) {
  .workspace-grid[data-step="export"] { grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); }
  .workspace-grid[data-step="client"] { grid-template-columns: minmax(0, 1.3fr) minmax(360px, 1fr); }
}
/* One primary action in Download: Save & share. Single and batch downloads read as clear secondary choices. */
.workflow-panel#panelExport .export-cards-grid .btn-primary { background: var(--bg-surface); color: var(--accent-text); border: 1px solid var(--accent-border); box-shadow: none; }
.workflow-panel#panelExport .export-cards-grid .btn-primary:hover { background: var(--accent-soft); }
[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"] { opacity: .75; }

/* Phones: bottom controls clear the home indicator and Safari's toolbar. */
@media (max-width: 600px) {
  .workspace-grid { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .preview-quick-actions { padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .wcu-logo-lockup, .step-tab, .rail-btn, .btn { transition: none !important; }
}

/* ======================= Preferences (More > Preferences), device-local ======================= */
/* Accent: workspace chrome only (buttons, selection, focus). Each pair keeps 4.5:1 in its theme. Cards never read these. */
html[data-accent="sage"] { --accent-primary: #345541; --accent-hover: #29432f; --accent-soft: #e7eee8; --accent-border: #b7cbbb; --accent-text: #2f4d3b; --accent-line: #345541; --focus-ring: #345541; }
html[data-accent="ink"] { --accent-primary: #2f3b63; --accent-hover: #232c4b; --accent-soft: #e9ecf5; --accent-border: #bcc5dc; --accent-text: #2f3b63; --accent-line: #2f3b63; --focus-ring: #2f3b63; }
html[data-accent="champagne"] { --accent-primary: #6b4f1f; --accent-hover: #553f18; --accent-soft: #f4ede1; --accent-border: #dcc9a6; --accent-text: #6b4f1f; --accent-line: #6b4f1f; --focus-ring: #6b4f1f; }
html[data-theme="dark"][data-accent="sage"] { --accent-primary: #3e6a50; --accent-hover: #4b7b5e; --accent-soft: rgba(169, 196, 176, 0.14); --accent-border: rgba(169, 196, 176, 0.4); --accent-text: #a9c4b0; --accent-line: #a9c4b0; --focus-ring: #a9c4b0; }
html[data-theme="dark"][data-accent="ink"] { --accent-primary: #44578f; --accent-hover: #52669f; --accent-soft: rgba(180, 194, 232, 0.14); --accent-border: rgba(180, 194, 232, 0.4); --accent-text: #b4c2e8; --accent-line: #b4c2e8; --focus-ring: #b4c2e8; }
html[data-theme="dark"][data-accent="champagne"] { --accent-primary: #7a5c24; --accent-hover: #8a6a2c; --accent-soft: rgba(226, 201, 146, 0.14); --accent-border: rgba(226, 201, 146, 0.4); --accent-text: #e2c992; --accent-line: #e2c992; --focus-ring: #e2c992; }

.header-more-panel { max-height: calc(100dvh - 96px); overflow: auto; overscroll-behavior: contain; }
.more-preferences { border: 1px solid var(--border-color); border-radius: var(--shell-radius-inner); background: var(--bg-surface); }
.more-preferences > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; font-weight: 700; font-size: 14px; color: var(--text-main); cursor: pointer; list-style: none; border-radius: var(--shell-radius-inner); }
.more-preferences > summary::-webkit-details-marker { display: none; }
.more-preferences > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -4px; }
.more-preferences[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.more-preferences > summary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.more-preferences-body { display: flex; flex-direction: column; gap: 10px; padding: 2px 10px 12px; }
.pref-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.pref-group > legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.pref-swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pref-swatch { position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-main); cursor: pointer; }
.pref-swatch input, .pref-segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pref-swatch:has(input:checked) { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent-text); }
.pref-swatch:has(input:focus-visible), .pref-segmented label:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.pref-swatch-dot { width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); }
.pref-swatch[data-accent="burgundy"] { --swatch: #7a1f3d; }
.pref-swatch[data-accent="sage"] { --swatch: #345541; }
.pref-swatch[data-accent="ink"] { --swatch: #2f3b63; }
.pref-swatch[data-accent="champagne"] { --swatch: #6b4f1f; }
html[data-theme="dark"] .pref-swatch-dot { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.pref-row-label { font-size: 14px; font-weight: 700; color: var(--text-main); }
.pref-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 999px; background: var(--bg-surface); color: var(--text-main); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.pref-switch-track { position: relative; width: 32px; height: 18px; border-radius: 999px; background: var(--border-strong); }
.pref-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.pref-switch[aria-checked="true"] .pref-switch-track { background: var(--accent-primary); }
.pref-switch[aria-checked="true"] .pref-switch-track::after { left: 16px; }
.pref-switch[aria-disabled="true"] { cursor: not-allowed; color: var(--text-muted); }
.pref-switch[aria-disabled="true"] .pref-switch-track { opacity: 0.5; }
.pref-switch:focus-visible, .pref-reset:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.pref-note { margin: -4px 0 0; font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.pref-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border: 1px solid var(--border-color); border-radius: 999px; }
.pref-segmented label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--text-main); cursor: pointer; }
.pref-segmented label:has(input:checked) { background: var(--accent-primary); color: var(--on-accent, #fff); }
.pref-reset { min-height: 44px; margin: 0; border: 1px solid var(--border-color); border-radius: 999px; background: var(--bg-surface); color: var(--text-main); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.pref-reset:hover, .pref-switch:hover:not([aria-disabled="true"]) { background: var(--bg-hover); }

/* ---------- optional wallpaper: behind the workspace only; panels stay opaque so editor contrast never changes ---------- */
.workspace-wallpaper {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--wallpaper-portrait); background-size: cover; background-position: center;
  opacity: 0.14; filter: sepia(0.35) saturate(0.7) contrast(0.85) brightness(1.15);
}
@media (min-aspect-ratio: 1/1) { .workspace-wallpaper { background-image: var(--wallpaper-landscape); } }
html[data-theme="dark"] .workspace-wallpaper { opacity: 0.14; filter: sepia(0.3) grayscale(0.35) brightness(0.62) contrast(0.9); }
html[data-wallpaper="on"] body { background: transparent; }
html[data-wallpaper="on"] { background: var(--bg-app); }
/* One brief flourish on deliberate navigation, tool change or zoom; never the card or the tools. */
.workspace-wallpaper.is-flourish { animation: wallpaper-flourish 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1; }
@keyframes wallpaper-flourish { from { transform: scale(1.015); opacity: 0.18; } to { transform: none; } }

/* ---------- brief original intro (once per session) ---------- */
.app-header .brand-group { position: relative; }
.brand-intro { position: absolute; left: 50%; top: 50%; width: 140px; height: 96px; transform: translate(-50%, -50%); pointer-events: none; z-index: 2; }

/* ---------- tiny dotted arc only while a real download is being prepared ---------- */
.btn[aria-busy="true"]::after {
  content: ""; display: inline-block; flex: none; width: 13px; height: 13px; margin-left: 8px; vertical-align: middle;
  border: 2px dotted currentColor; border-top-color: transparent; border-radius: 50%;
  animation: busy-arc 0.9s linear infinite;
}
@keyframes busy-arc { to { transform: rotate(360deg); } }

/* ---------- Motion: Off (and the OS Reduce Motion setting): everything still works, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn[aria-busy="true"]::after, .workspace-wallpaper.is-flourish { animation: none; }
  .brand-intro { display: none; }
}
html[data-motion="off"] { scroll-behavior: auto !important; }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html[data-motion="off"] .brand-intro { display: none; }

/* ---------- project title row: the one visible, editable title, above the guest picker ----------
   Same side padding and gap as the guest picker below it; a quiet themed field (no bright slab in dark mode);
   the text wraps and the field grows, so a long title is never cut off or scrolled sideways while editing. */
.project-title-row { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--border-color); background: var(--bg-surface); min-width: 0; }
.project-title-label { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--text-muted); }
/* By id, so the older light/dark field rules (which would make a bright slab in dark mode) cannot override it. */
#projectTitleInput {
  display: block; box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 10px 12px;
  border: 1px solid var(--border-color); border-radius: var(--shell-radius-inner);
  background: var(--bg-subtle); color: var(--text-main); box-shadow: none;
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.4;
  resize: none; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; field-sizing: content;
}
#projectTitleInput:hover { border-color: var(--border-strong); }
#projectTitleInput:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-color: var(--border-strong); background: var(--bg-surface); }
#projectTitleInput::placeholder { color: var(--text-muted); font-weight: 600; opacity: 1; }
@media (max-width: 600px) {
  .project-title-row { order: 2; padding: 8px 12px; }
  #projectTitleInput { font-size: 16px; }
  /* Guests on a phone keeps the card and guest picker together on one screen; the title is edited in Design or Download. */
  .workspace-grid[data-step="client"] .project-title-row { display: none; }
}
