/**
 * styles.css
 * Wedding Cards Guest Card — Restrained, clean Navy/White workspace with Burgundy primary actions,
 * spacious floating two-tier header, progressive disclosure, and Light / Dark / System appearance modes.
 */

:root {
  color-scheme: light;
  --bg-app: #f3f1ed;
  --bg-surface: #ffffff;
  --bg-subtle: #f7f6f2;
  --bg-hover: #eceef4;
  --bg-stage: #dcdce4;

  --border-color: #dcdce4;
  --border-strong: #a9adc0;

  --text-main: #2a2d42;
  --text-secondary: #41445c;
  --text-muted: #555971;

  --accent-primary: #703e46;
  --accent-hover: #593038;
  --accent-soft: #f2e9e7;
  --accent-border: #e1bccb;
  --accent-text: #703e46;
  --on-accent: #ffffff;

  --gold: #7a1f3d;
  --gold-soft: #e6f0f8;
  --gold-border: #b9d3e8;

  --navy-accent: #2a2d42;
  --focus-ring: #703e46;

  --status-ready-bg: #edf2e9;
  --status-ready-text: #3b633e;
  --status-ready-border: #b6d6c8;

  --status-warn-bg: #e6f0f8;
  --status-warn-text: #1d4f73;
  --status-warn-border: #b9d3e8;

  --status-danger-bg: #f6eae7;
  --status-danger-text: #8a1d3d;
  --status-danger-border: #e6bccb;

  --status-info-bg: #edf1ef;
  --status-info-text: #3e605c;
  --status-info-border: #c2d3cc;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-header: 0 4px 20px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-card: 0 2px 12px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-preview: 0 10px 30px rgba(15, 23, 42, 0.08);

  --font-display: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-ui: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-mono: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;

  --header-offset: 140px;

  /* Aliases for names referenced throughout the sheet; resolve to the themed tokens above */
  --primary-burgundy: var(--accent-primary);
  --border-soft: var(--border-color);
  --border-subtle: var(--border-color);
  --text-primary: var(--text-main);
  --transition-fast: 0.15s ease;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-app: #1a1c25;
  --bg-surface: #222530;
  --bg-subtle: #292c39;
  --bg-hover: #333647;
  --bg-stage: #15171f;

  --border-color: #3d4154;
  --border-strong: #5e6480;

  --text-main: #f0f0f4;
  --text-secondary: #d5dae6;
  --text-muted: #a9adc0;

  --accent-primary: #a8395c;
  --accent-hover: #bd4a6f;
  --accent-soft: rgba(185, 126, 126, 0.14);
  --accent-border: rgba(185, 126, 126, 0.38);
  --accent-text: #e8a6bb;
  --accent-line: #e8a6bb;
  --on-accent: #ffffff;

  --gold: #a9c8e6;
  --gold-soft: rgba(184, 195, 169, 0.12);
  --gold-border: rgba(184, 195, 169, 0.30);

  --navy-accent: #2f3242;
  --brand-navy: #b5beb3;
  --focus-ring: #e8a6bb;

  --status-ready-bg: rgba(22, 101, 52, 0.25);
  --status-ready-text: #9fd6bf;
  --status-ready-border: #3b633e;

  --status-warn-bg: rgba(133, 77, 14, 0.25);
  --status-warn-text: #a8c3de;
  --status-warn-border: #34476a;

  --status-danger-bg: rgba(153, 27, 27, 0.25);
  --status-danger-text: #efb3c6;
  --status-danger-border: #8a1d3d;

  --status-info-bg: rgba(3, 105, 161, 0.25);
  --status-info-text: #aecac2;
  --status-info-border: #0369a1;

  --shadow-header: 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 2px 14px rgba(0, 0, 0, 0.35);
  --shadow-preview: 0 12px 36px rgba(0, 0, 0, 0.55);
}

/* Dark mode logo styling: invert web logo to luminous off-white so it sits natively in the dark header */
html[data-theme="dark"] .brand-home-btn {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .brand-home-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-soft);
}

html[data-theme="dark"] .brand-home-btn .wcu-logo-lockup {
  filter: brightness(0) invert(0.98) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

html[data-theme="dark"] .wcu-logo-mark {
  filter: brightness(0) invert(0.92);
}

/* Dark mode tab contrast & active indicators */
html[data-theme="dark"] .step-tab {
  color: var(--text-secondary);
}

html[data-theme="dark"] .step-tab:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

html[data-theme="dark"] .step-tab.active {
  color: var(--accent-text);
}

html[data-theme="dark"] .step-tab.active::after {
  background: var(--accent-line);
}

html[data-theme="dark"] .step-tab .step-num {
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

html[data-theme="dark"] .step-tab.active .step-num {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
}

/* Dark mode buttons & CTAs */
html[data-theme="dark"] .btn-cta-pill {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(190, 18, 60, 0.35);
}

html[data-theme="dark"] .btn-cta-pill:hover {
  background: var(--accent-hover);
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-outline {
  background: #1c1d21;
  border-color: var(--border-color);
  color: var(--text-main);
}

html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: #ffffff;
}

/* Dark mode mode tabs and sub tabs */
html[data-theme="dark"] .mode-tab.active,
html[data-theme="dark"] .sub-tab.active {
  background: rgba(190, 18, 60, 0.22);
  color: #e8a6bb;
  border-color: #bd4a6f;
}

html[data-theme="dark"] .btn-outline-danger {
  background: rgba(153, 27, 27, 0.18);
  color: #efb3c6;
  border-color: #7f1d1d;
}

html[data-theme="dark"] .btn-outline-danger:hover:not(:disabled) {
  background: rgba(153, 27, 27, 0.32);
  border-color: #8a1d3d;
  color: #ffffff;
}

/* Dark mode filter pills */
html[data-theme="dark"] .filter-pill {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

html[data-theme="dark"] .filter-pill:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .filter-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

html[data-theme="dark"] .filter-pill .pill-count {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}

html[data-theme="dark"] .filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.28);
}

/* Dark mode template cards */
html[data-theme="dark"] .template-card {
  background: var(--bg-surface);
  border-color: var(--border-color);
}

html[data-theme="dark"] .template-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

html[data-theme="dark"] .template-card.active {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 1px var(--accent-line), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Dark mode form controls */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .input-text,
html[data-theme="dark"] .input-select,
html[data-theme="dark"] .input-textarea,
html[data-theme="dark"] .row-name-input,
html[data-theme="dark"] .row-adm-input {
  color-scheme: dark;
  background: #20222c;
  border: 1px solid #464a60;
  color: #f4f5f9;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] .row-name-input::placeholder,
html[data-theme="dark"] .row-adm-input::placeholder {
  color: #a9adc0;
  opacity: 1;
}

html[data-theme="dark"] input[type="text"]:focus,
html[data-theme="dark"] input[type="number"]:focus,
html[data-theme="dark"] input[type="search"]:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .input-text:focus,
html[data-theme="dark"] .input-select:focus,
html[data-theme="dark"] .input-textarea:focus,
html[data-theme="dark"] .row-name-input:focus,
html[data-theme="dark"] .row-adm-input:focus {
  border-color: #e8a6bb;
  background: #111c33;
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.25);
  outline: none;
}

html[data-theme="dark"] input:disabled,
html[data-theme="dark"] select:disabled,
html[data-theme="dark"] textarea:disabled {
  background: #141f33;
  border-color: #222327;
  color: #555971;
  cursor: not-allowed;
}

/* Dark mode guest review table */
html[data-theme="dark"] .guest-table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .guest-table td {
  border-bottom-color: var(--border-color);
}

html[data-theme="dark"] .guest-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .guest-table tr.active-preview-row td {
  background: rgba(232, 166, 187, 0.14);
}

html[data-theme="dark"] .guest-table tr.row-invalid td {
  background: rgba(153, 27, 27, 0.22);
}

/* Dark mode align button group */
html[data-theme="dark"] .align-btn-group {
  background: #2a2d42;
  border-color: var(--border-color);
}

html[data-theme="dark"] .btn-align-icon {
  border-right-color: var(--border-color);
  color: var(--text-secondary);
}

html[data-theme="dark"] .btn-align-icon:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

html[data-theme="dark"] .btn-align-icon.active {
  background: var(--accent-primary);
  color: #ffffff;
}

/* Dark mode links & subtle text */
html[data-theme="dark"] .link-btn-subtle {
  color: var(--accent-text);
}

html[data-theme="dark"] .link-btn-subtle:hover {
  color: #ffffff;
}

html[data-theme="dark"] .badge-subtle {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

html[data-theme="dark"] .badge-accent,
html[data-theme="dark"] .badge.badge-accent {
  background: rgba(232, 166, 187, 0.2);
  color: #e8a6bb;
  border: 1px solid rgba(232, 166, 187, 0.45);
}

html[data-theme="dark"] .badge-name,
html[data-theme="dark"] .field-badge.badge-name {
  background: rgba(232, 166, 187, 0.2);
  color: #e8a6bb;
  border: 1px solid rgba(232, 166, 187, 0.45);
}

html[data-theme="dark"] .badge-adm,
html[data-theme="dark"] .field-badge.badge-adm {
  background: rgba(56, 189, 248, 0.16);
  color: #c2d3cc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

html[data-theme="dark"] .section-meta {
  background: #20222c;
  color: #d5dae6;
  border: 1px solid #464a60;
}

html[data-theme="dark"] .step-badge {
  background: rgba(120, 156, 196, 0.2);
  color: #a8c3de;
  border: 1px solid rgba(120, 156, 196, 0.4);
}

html[data-theme="dark"] .active-client-badge {
  background: #20222c;
  border-color: #464a60;
  color: #f4f5f9;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  font-synthesis: none;
}

html,
body,
button,
input,
select,
textarea,
table,
th,
td,
label,
summary,
code {
  font-family: var(--font-ui);
  font-synthesis: none;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-weight: 800;
  font-synthesis: none;
  font-size: 14.5px;
  line-height: 1.72;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   SPACIOUS FLOATING TWO-TIER WHITE HEADER
   ========================================================================== */
.app-header {
  padding: 16px 28px 0;
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, var(--bg-app) 75%, rgba(243, 245, 248, 0) 100%);
}

.header-card {
  max-width: 1540px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-header);
  overflow: hidden;
}

.header-top-row {
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 52px;
  text-decoration: none;
}

.brand-home-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-soft);
  transform: translateY(-1px);
}

.brand-home-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.brand-lockup-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wcu-logo-lockup {
  height: 52px;
  width: auto;
  aspect-ratio: 432.35 / 157.83;
  display: block;
  flex-shrink: 0;
  transition: filter var(--transition-fast), transform 0.15s ease;
  filter: drop-shadow(0 1px 1.5px rgba(3, 5, 5, 0.08));
}

.brand-subordinate-label {
  display: none;
}

.wcu-logo-mark {
  height: 30px;
  width: auto;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}

.brand-divider {
  display: none;
}

.header-nav-cluster {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.step-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 800;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}

.step-tab:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.step-tab.active {
  color: var(--accent-primary);
  font-weight: 700;
}

.step-tab.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2.5px;
  background: var(--accent-primary);
  border-radius: 2px;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.step-tab.active .step-num {
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.step-badge {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border: 1px solid var(--status-warn-border);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.btn-cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 7px 8px 7px 20px;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-cta-pill:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.cta-arrow-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

/* Secondary Mode Row */
.header-mode-row {
  padding: 7px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.mode-status-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  min-width: 0;
  flex-wrap: wrap;
}

.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  flex-shrink: 0;
}

.brand-subtitle {
  font-weight: 600;
  color: var(--text-main);
}

.mode-sep {
  color: var(--border-strong);
}

.draft-note {
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================================================
   SEGMENTED TOGGLE SWITCH CONTROLS (HEADER MODE & THEME)
   ========================================================================== */
.mode-switcher-pills {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.appearance-control {
  display: inline-flex;
  align-items: center;
}

.segmented-track {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  user-select: none;
}

.segmented-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.16s ease;
  outline: none;
  white-space: nowrap;
}

.segmented-btn:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.04);
}

.segmented-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.segmented-btn.active {
  background: var(--bg-surface);
  color: var(--accent-primary);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.theme-seg-btn {
  padding: 6px 10px;
  font-size: 12.5px;
}

.theme-seg-btn .seg-icon {
  font-size: 13px;
  line-height: 1;
}

.mode-seg-btn .seg-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 0.16s ease;
}

.mode-seg-btn.active .seg-indicator {
  background: var(--accent-primary);
}

.mode-seg-btn .seg-desc {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.85;
}

.mode-seg-btn.active .seg-desc {
  color: var(--accent-primary);
  opacity: 0.9;
}

/* Dark Mode Harmonious Palette for Segmented Toggles */
html[data-theme="dark"] .segmented-track {
  background: #15171f;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .segmented-btn {
  color: #a9adc0;
}

html[data-theme="dark"] .segmented-btn:hover {
  color: #e6e8f0;
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .segmented-btn.active {
  background: #2f3242;
  color: #e8a6bb;
  border-color: rgba(232, 166, 187, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .mode-seg-btn.active .seg-indicator {
  background: #bd4a6f;
}

html[data-theme="dark"] .mode-seg-btn.active .seg-desc {
  color: #e8a6bb;
}

/* Deprecated legacy pill dot support */
.mode-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
}

.mode-pill.active .pill-dot {
  background: var(--accent-primary);
}

/* ==========================================================================
   SIMULATED CLIENT LINK BAR
   ========================================================================== */
.sim-client-banner {
  max-width: 1540px;
  margin: 12px auto 0;
  padding: 0 28px;
}

.sim-client-inner {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sim-client-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.sim-client-info code {
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-main);
}

.sim-client-actions {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   MAIN TWO-COLUMN WORKSPACE GRID
   ========================================================================== */
.workspace-grid {
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px 28px max(160px, 40vh);
  display: grid;
  grid-template-columns: minmax(430px, 0.94fr) minmax(500px, 1.06fr);
  gap: 32px;
  align-items: start;
}

.controls-column {
  min-width: 0;
}

.workflow-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 4px;
  flex-wrap: wrap;
}

.step-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.panel-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  font-synthesis: none;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.2;
}

.header-btn-group {
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   CLEAN WHITE WORKSPACE CARDS (NO VERTICAL ACCENT STRIPES)
   ========================================================================== */
.card-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-card);
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-title-row h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  font-synthesis: none;
  letter-spacing: -0.015em;
  color: var(--text-main);
  line-height: 1.3;
}

.section-meta {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.section-help {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.font-status-footnote {
  margin: 18px 0 0;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.font-status-footnote code {
  font-family: var(--font-mono);
  font-size: 12px;
}

.subtle-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 22px 0;
}

.toggle-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-title input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-primary);
}

/* ==========================================================================
   TEMPLATE SELECTOR & UPLOAD ZONE
   ========================================================================== */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.preset-card {
  text-align: left;
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.preset-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}

.preset-card.active {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

.preset-card strong {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.preset-card span {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.upload-zone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  background: var(--bg-subtle);
  margin-bottom: 22px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-zone.dragover {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
}

.upload-zone-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.upload-text strong {
  font-size: 15px;
  color: var(--text-main);
}

.upload-text span {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.upload-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-status {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.essential-sizing-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

/* ==========================================================================
   FIELD SUB-CARDS & PROGRESSIVE DISCLOSURE (<details>)
   ========================================================================== */
.field-group-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.field-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.field-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.badge-name {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border: 1px solid var(--accent-border);
}

.badge-adm {
  background: #e6e8f0;
  color: var(--navy-accent);
  border: 1px solid var(--border-strong);
}

.disclosure-group {
  margin-top: 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  overflow: hidden;
}

.disclosure-summary {
  padding: 14px 20px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  user-select: none;
  transition: background 0.15s ease;
}

.disclosure-summary::-webkit-details-marker {
  display: none;
}

.disclosure-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--accent-primary);
  font-size: 15px;
  transition: transform 0.15s ease;
}

.disclosure-group[open] > .disclosure-summary::before {
  transform: rotate(90deg);
}

.disclosure-summary:hover {
  background: var(--bg-hover);
}

.disclosure-hint {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.disclosure-body {
  padding: 22px 22px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

/* ==========================================================================
   CONTROLS GRIDS & INPUTS
   ========================================================================== */
.controls-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.controls-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.controls-grid-3:last-child,
.controls-grid-2:last-child {
  margin-bottom: 0;
}

.controls-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.fg-span-2 {
  grid-column: span 2;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.control-group label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.35;
}

.control-group-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.form-row-inline {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-row-inline label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.input-text,
.input-select,
.input-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-text:focus,
.input-select:focus,
.input-textarea:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgba(124, 25, 54, 0.12);
}

.input-narrow {
  width: 92px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
  margin: 8px 0 2px;
  height: 6px;
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-height: 44px;
  box-sizing: border-box;
  background: var(--bg-surface);
}

.color-picker-wrap input[type="color"] {
  width: 28px;
  height: 28px;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}

.color-hex {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

/* Color Sampling & Eyedropper Styles */
.control-group-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.eyedropper-scope-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
}

.eyedropper-scope-badge.supported {
  background: rgba(16, 185, 129, 0.12);
  color: #426b49;
  border-color: rgba(16, 185, 129, 0.25);
}

.color-picker-composite-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.eyedropper-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.eyedropper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  height: 44px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.eyedropper-btn.active {
  background: var(--color-primary, #8a1d3d);
  color: #ffffff;
  border-color: var(--color-primary, #8a1d3d);
  box-shadow: 0 0 0 2px rgba(153, 27, 27, 0.3);
}

.color-sampler-bar {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated, var(--bg-surface));
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

.color-sampler-bar.hidden {
  display: none !important;
}

.sampler-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sampler-swatch-box {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sampler-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.sampler-text-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sampler-code-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sampler-hex-input {
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  font-weight: 700;
  width: 78px;
  padding: 2px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
  text-transform: lowercase;
}

.sampler-rgb {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--text-muted);
}

.sampler-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  min-height: 28px;
  height: 28px;
  border-radius: 4px;
  font-weight: 700;
}

.sampler-notice {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sampler-perm-notice {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.35;
}

.sampler-perm-notice.allowed {
  background: rgba(16, 185, 129, 0.1);
  color: #426b49;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.sampler-perm-notice.restricted {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.sampler-snap-btn {
  background: var(--bg-surface);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #b91c1c;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
}

.checkbox-label,
.checkbox-label-compact {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"],
.checkbox-label-compact input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-primary);
}

/* ==========================================================================
   PAGE SIZING & DPI ASSUMPTION DIAGNOSTICS (CLEAN FLAT BORDERS — NO VERTICAL STRIPE)
   ========================================================================== */
.dpi-assumption-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.dpi-assumption-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.dpi-assumption-header strong {
  font-size: 14px;
  color: var(--text-main);
}

.meta-tag {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 3px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.dpi-assumption-text {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.dpi-assumption-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dpi-assumption-controls label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sizing-locks-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.sizing-locks-row code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
}

.sizing-lock-actions {
  display: flex;
  gap: 8px;
}

.sizing-summary-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  background: var(--bg-subtle);
  font-size: 13.5px;
}

.sizing-summary-box.warn {
  background: var(--status-warn-bg);
  border-color: var(--status-warn-border);
}

.sizing-summary-box.error {
  background: var(--status-danger-bg);
  border-color: var(--status-danger-border);
}

.sizing-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

.sizing-metric-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sizing-metric-pill span {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.sizing-metric-pill strong {
  font-size: 13.5px;
  color: var(--text-main);
}

.sizing-alert-list {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.55;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  font-family: var(--font-ui);
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-xs {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 13px;
}

.btn-sm {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
}

.btn-md {
  min-height: 46px;
  padding: 11px 22px;
  font-size: 15px;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: #a9adc0;
}

.btn-outline-danger {
  background: var(--bg-surface);
  color: var(--status-danger-text);
  border-color: var(--status-danger-border);
}

.btn-outline-danger:hover:not(:disabled) {
  background: var(--status-danger-bg);
}

.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  transition: background 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg-hover);
}

.panel-footer-bar,
.review-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 26px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

.review-footer-bar {
  margin-top: 20px;
  padding: 18px 0 0;
  border: none;
  border-top: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: none;
}

/* ==========================================================================
   STEP 2: GUEST IMPORT & REVIEW TABLE
   ========================================================================== */
.input-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.mode-tab {
  min-height: 44px;
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.mode-tab:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.mode-tab.active {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border-color: var(--accent-border);
}

.import-mode-row {
  margin-top: 14px;
}

.single-guest-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.fg-grow {
  flex: 2 1 200px;
}

.fg-narrow {
  flex: 0 0 88px;
}

.fg-med {
  flex: 1 1 150px;
}

.paste-actions-row {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.bulk-fix-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.review-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 15px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.filter-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.pill-count {
  font-size: 12px;
  background: rgba(15, 23, 42, 0.07);
  padding: 1px 7px;
  border-radius: 999px;
}

.filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.24);
}

.guest-table-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-height: 480px;
  overflow-y: auto;
}

.guest-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.guest-table th {
  position: sticky;
  top: 0;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.guest-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.guest-table tr.active-preview-row {
  background: var(--accent-soft);
}

.guest-table tr.row-invalid {
  background: #fff8f8;
}

.col-inc {
  width: 40px;
  text-align: center;
}

.col-row {
  width: 46px;
  color: var(--text-muted);
}

.col-adm {
  width: 82px;
}

.col-status {
  width: 210px;
}

.col-actions {
  width: 170px;
}

.row-name-input,
.row-adm-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: var(--font-ui);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-main);
}

.row-name-input:hover,
.row-adm-input:hover,
.row-name-input:focus,
.row-adm-input:focus {
  border-color: var(--border-strong);
  background: var(--bg-surface);
  outline: none;
}

.status-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  margin-right: 4px;
}

.chip-ready {
  background: var(--status-ready-bg);
  color: var(--status-ready-text);
}

.chip-invalid {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.chip-duplicate {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}

.chip-long {
  background: var(--status-info-bg);
  color: var(--status-info-text);
}

.issue-detail-text {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

.row-actions-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.review-summary-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.align-btn-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-surface);
  width: 100%;
}

.btn-align-icon {
  flex: 1;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-color);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-align-icon:last-child {
  border-right: none;
}

.btn-align-icon:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-align-icon.active {
  background: var(--brand-navy);
  color: #ffffff;
}

.label-with-reset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.link-btn-subtle {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--accent-primary);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn-subtle:hover {
  color: var(--accent-hover);
}

/* ==========================================================================
   STEP 3: EXPORT & GALLERY
   ========================================================================== */
.readiness-banner {
  padding: 16px 22px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  border: 1px solid var(--border-color);
  line-height: 1.55;
}

.readiness-banner.clean {
  background: var(--status-ready-bg);
  border-color: var(--status-ready-border);
  color: var(--status-ready-text);
}

.readiness-banner.warn {
  background: var(--status-warn-bg);
  border-color: var(--status-warn-border);
  color: var(--status-warn-text);
}

.export-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.export-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.batch-progress {
  margin-top: 14px;
}

.progress-bar-track {
  height: 7px;
  background: var(--bg-app);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  transition: width 0.15s ease;
}

.progress-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.card-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.gallery-mode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-mode-actions .btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.thumb-inspect-cta {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent-primary) !important;
}

.single-card-detail-view {
  margin-top: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  padding: 20px;
}

.detail-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.detail-step-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-position-label {
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 0 6px;
}

.detail-body-grid {
  display: grid;
  grid-template-columns: minmax(200px, 0.9fr) minmax(240px, 1.1fr);
  gap: 24px;
  align-items: center;
}

.detail-preview-stage {
  background: #2a2d42;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-preview-stage img {
  width: auto;
  max-width: 100%;
  max-height: min(46vh, 380px);
  height: auto;
  border-radius: 4px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  display: block;
}

.detail-meta-column h4 {
  margin: 4px 0 12px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.detail-badges-row {
  margin-bottom: 14px;
}

.detail-specs-list {
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
}

.detail-specs-list > div {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.detail-specs-list dt {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.detail-specs-list dd {
  margin: 0;
  font-size: 14px;
  color: var(--text-main);
}

.gallery-thumb-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.gallery-thumb-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.gallery-thumb-card.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.gallery-thumb-card img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg-stage);
}

.gallery-thumb-meta {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gallery-thumb-meta strong {
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-thumb-meta span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   RIGHT STICKY COLUMN: DOMINANT LIVE INVITATION CARD PREVIEW
   ========================================================================== */
.preview-column {
  min-width: 0;
  align-self: stretch;
}

.preview-card-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: var(--header-offset, 140px);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: var(--shadow-preview);
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-offset, 140px) - 24px);
  transition: top var(--transition-fast);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.preview-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-wcu-icon {
  height: 20px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  object-fit: contain;
}

html[data-theme="dark"] .preview-wcu-icon {
  filter: brightness(0) invert(0.92);
}

.live-dot {
  display: none;
}

.preview-toolbar-left strong {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.preview-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mobile-only-btn {
  display: none;
}

.preview-guest-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.preview-guest-select {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  max-width: 100%;
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-stage-wrapper {
  background-color: #15171f;
  background-image: radial-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: auto;
  overscroll-behavior: contain;
  position: relative;
  flex-shrink: 0;
}

/* Fit mode shows the whole card; only a zoomed card scrolls inside a bounded stage */
.canvas-stage-wrapper.is-zoomed {
  justify-content: flex-start;
  align-items: center;
  flex-shrink: 1;
  max-height: min(calc(100vh - var(--header-offset, 140px) - 240px), 580px);
}

.canvas-stage-wrapper.canvas-Stage-compact canvas {
  max-height: 200px !important;
}

#invitationCanvas {
  width: auto;
  max-width: 100%;
  max-height: var(--preview-canvas-max, clamp(260px, calc(100vh - var(--header-offset, 140px) - 300px), 520px));
  height: auto;
  object-fit: contain;
  background: #f7f8fb;
  border-radius: 4px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: grab;
  touch-action: none;
  display: block;
  flex-shrink: 0;
  transition: width 0.18s ease, height 0.18s ease;
}

#invitationCanvas:active {
  cursor: grabbing;
}

.canvas-stage-wrapper.sampling-mode #invitationCanvas {
  cursor: crosshair !important;
}

.canvas-sampler-loupe {
  position: absolute;
  pointer-events: none;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  transform: translate(-50%, -135%);
  transition: opacity 0.1s ease;
}

.canvas-sampler-loupe.hidden {
  display: none !important;
}

.loupe-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.canvas-drag-hint,
.preview-drag-guide-row {
  margin-top: 0;
  padding: 6px 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  line-height: 1.35;
  flex-shrink: 0;
}

html[data-theme="dark"] .canvas-drag-hint,
html[data-theme="dark"] .preview-drag-guide-row {
  color: #d5dae6;
  background: var(--bg-surface-elevated, var(--bg-surface));
}

.preview-diagnostics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 9px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.diag-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.diag-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.diag-item strong {
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (TABLET & PHONE)
   ========================================================================== */
@media (max-width: 1080px) {
  .app-header {
    padding: 12px 20px 0;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    padding: 20px 20px 44px;
  }

  .preview-column {
    position: static;
    order: -1;
    align-self: auto;
  }

  .preview-card-sticky {
    position: static;
    max-height: none;
  }

  #invitationCanvas {
    max-height: min(42vh, 380px);
  }
}

@media (max-width: 860px) {
  .guest-table-container {
    border: none;
    overflow-x: visible;
    max-height: none;
    overflow-y: visible;
  }

  .guest-table,
  .guest-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .guest-table thead {
    display: none;
  }

  .guest-table tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px 12px;
    align-items: center;
    padding: 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
  }

  .guest-table td {
    padding: 0;
    border: none;
    width: auto !important;
  }

  .guest-table td.col-inc {
    grid-column: 1;
    grid-row: 1;
  }

  .guest-table td.col-row {
    grid-column: 2;
    grid-row: 1;
  }

  .guest-table td.col-status {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .guest-table td.col-name {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .guest-table td.col-adm {
    grid-column: 1 / 3;
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .guest-table td.col-adm::before {
    content: "Admits:";
    font-size: 13px;
    color: var(--text-secondary);
  }

  .guest-table td.col-adm .row-adm-input {
    width: 78px;
  }

  .guest-table td.col-actions {
    grid-column: 3;
    grid-row: 3;
    justify-self: end;
  }
}

@media (max-width: 680px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-header {
    padding: 8px 12px 0;
  }

  .header-top-row {
    padding: 12px 14px;
    gap: 10px;
  }

  .header-mode-row {
    padding: 8px 14px;
    gap: 8px;
  }

  .brand-group {
    gap: 8px;
  }

  .brand-home-btn {
    min-height: 48px;
    padding: 6px 12px;
  }

  .wcu-logo-mark {
    height: 30px;
  }

  .wcu-logo-lockup {
    height: 44px;
    filter: drop-shadow(0 1px 1px rgba(3, 5, 5, 0.08));
  }

  .draft-note,
  .mode-sep,
  .disclosure-hint,
  .btn-cta-pill {
    display: none;
  }

  .brand-divider {
    display: none;
  }

  .brand-subordinate-label {
    font-size: 11px;
    letter-spacing: 0.18em;
    white-space: nowrap;
  }

  .header-nav-cluster {
    width: 100%;
  }

  .step-tabs {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
  }

  .step-tab {
    flex: 1;
    justify-content: center;
    min-height: 44px;
    padding: 7px 6px;
    font-size: 12.5px;
    gap: 4px;
  }

  .mode-switcher-pills {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .appearance-control {
    flex: 1 1 auto;
    width: 100%;
  }

  .theme-segmented-track {
    width: 100%;
    justify-content: space-between;
  }

  .theme-seg-btn {
    flex: 1;
    padding: 6px 4px;
    font-size: 11.5px;
    gap: 3px;
    min-height: 44px;
  }

  .mode-segmented-track {
    width: 100%;
  }

  .mode-seg-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    font-size: 12px;
    min-height: 44px;
  }

  .mode-seg-btn .seg-desc {
    display: none;
  }

  .workspace-grid {
    padding: 12px 12px 32px;
    gap: 16px;
  }

  .card-section {
    padding: 18px 16px;
  }

  .field-group-card,
  .disclosure-body {
    padding: 16px 14px;
  }

  .disclosure-summary {
    min-height: 46px;
    padding: 12px 14px;
    font-size: 13.5px;
    flex-wrap: wrap;
  }

  .form-row-inline {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .preset-grid,
  .essential-sizing-row,
  .controls-grid-4,
  .controls-grid-3,
  .controls-grid-2,
  .sizing-metrics-grid,
  .export-cards-grid,
  .detail-body-grid {
    grid-template-columns: 1fr;
  }

  .card-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  #invitationCanvas {
    max-height: min(36vh, 270px);
  }

  .fg-span-2 {
    grid-column: span 1;
  }

  .preview-diagnostics {
    grid-template-columns: repeat(2, 1fr);
  }

  .mobile-only-btn {
    display: inline-flex;
  }
}

/* ==========================================================================
   APPLY SCOPE BAR, APPEARANCE SWITCHER, PER-GUEST QR & EDITABLE ROW NOTES
   ========================================================================== */
.apply-scope-bar {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.apply-scope-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qr-resolved-preview {
  display: inline-block;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 6px;
  max-width: 100%;
  overflow-x: auto;
}

.row-notes-input {
  width: 100%;
  min-height: 36px;
  margin-top: 6px;
  padding: 5px 8px;
  font-size: 12.5px;
  font-family: var(--font-ui);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.row-notes-input:focus {
  outline: none;
  border-color: var(--focus-ring);
}

.appearance-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.appearance-select {
  min-height: 44px;
  padding: 6px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
}

.font-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 999px;
}

.font-status-pill.warn {
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
  border-color: var(--status-warn-border);
}

/* ============================================================================
   DESIGN JOURNEY, PRICING TIERS & STUDIO MANAGEMENT
   ============================================================================ */
.journey-selector-card {
  margin-bottom: 16px;
}

.journey-segmented-track {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.journey-seg-btn {
  flex: 1;
  min-width: 180px;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  color: var(--text-main);
  font-family: var(--font-ui);
}

.journey-seg-btn:hover {
  border-color: var(--primary-burgundy);
  background: var(--bg-subtle);
}

.journey-seg-btn.active {
  border-color: var(--primary-burgundy);
  background: var(--bg-surface);
  box-shadow: 0 0 0 2px rgba(92, 29, 36, 0.2);
}

.journey-btn-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.journey-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.journey-btn-text strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.journey-btn-text small {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.pricing-category-banner {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pricing-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.pricing-tier-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-burgundy);
  color: #ffffff;
}

.pricing-rate-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(184, 134, 11, 0.15);
  color: #a8395c;
  border: 1px solid rgba(184, 134, 11, 0.35);
}

.pricing-tier-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
  margin: 0;
}

.pricing-disclaimer-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.03);
  padding: 8px 12px;
  border-radius: 6px;
}

.simulation-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.25);
  white-space: nowrap;
}

.staff-assignment-panel {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.assignment-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.active-client-badge {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.staff-permissions-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  margin-top: 10px;
}

.staff-permissions-box h4 {
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-main);
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.permitted-swatches-row {
  margin-bottom: 14px;
}

.swatches-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.color-swatch-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  min-height: 40px;
  transition: all 0.15s ease;
  font-family: var(--font-ui);
}

.color-swatch-chip:hover {
  border-color: var(--primary-burgundy);
}

.color-swatch-chip.active {
  border-color: var(--primary-burgundy);
  box-shadow: 0 0 0 2px rgba(92, 29, 36, 0.25);
  font-weight: 700;
}

.color-swatch-preview {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.staff-briefs-summary {
  margin-top: 14px;
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
}

.briefs-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.brief-preview-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brief-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.brief-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.brief-preview-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(120, 156, 196, 0.15);
  color: #33506b;
  border: 1px solid rgba(120, 156, 196, 0.3);
}

.brief-preview-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.brief-preview-notes {
  font-size: 12px;
  font-style: italic;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 4px 8px;
  border-radius: 4px;
}

.empty-briefs-note {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 6px 0;
}

.bespoke-request-card {
  margin-bottom: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
}

.brief-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.brief-form-grid .full-width {
  grid-column: 1 / -1;
}

.brief-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.brief-status-msg {
  font-size: 12.5px;
  font-weight: 600;
  color: #16a34a;
}

.active-focus-upload {
  border-color: var(--primary-burgundy) !important;
  background: rgba(92, 29, 36, 0.04) !important;
  box-shadow: 0 0 0 2px rgba(92, 29, 36, 0.2);
}

/* Dark Mode Overrides */
html[data-theme="dark"] .card-section {
  background: #222530;
  border-color: #3d4154;
}

html[data-theme="dark"] .field-group-card {
  background: #292c39;
  border-color: #464a60;
}

html[data-theme="dark"] .disclosure-group {
  background: #292c39;
  border-color: #464a60;
}

html[data-theme="dark"] .journey-seg-btn {
  background: #20222c;
  border-color: #464a60;
  color: #d5dae6;
}

html[data-theme="dark"] .journey-seg-btn:hover {
  background: #292c39;
  border-color: #e8a6bb;
}

html[data-theme="dark"] .journey-seg-btn.active {
  background: #292c39;
  border-color: #e8a6bb;
  color: #f4f5f9;
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.3);
}

html[data-theme="dark"] .pricing-category-banner {
  background: #292c39;
  border-color: #464a60;
}

html[data-theme="dark"] .pricing-tier-badge {
  background: rgba(232, 166, 187, 0.24);
  color: #ffe4e6;
  border: 1px solid rgba(232, 166, 187, 0.45);
}

html[data-theme="dark"] .pricing-rate-status {
  background: rgba(120, 156, 196, 0.18);
  color: #a9c8e6;
  border-color: rgba(120, 156, 196, 0.4);
}

html[data-theme="dark"] .pricing-disclaimer-box {
  background: #20222c;
  color: #d5dae6;
  border-top-color: #3d4154;
  border-right-color: #3d4154;
  border-bottom-color: #3d4154;
}

html[data-theme="dark"] .simulation-tag {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.4);
}

html[data-theme="dark"] .staff-assignment-panel {
  background: #222530;
  border-color: #3d4154;
}

html[data-theme="dark"] .staff-permissions-box {
  background: #292c39;
  border-color: #464a60;
}

html[data-theme="dark"] .color-swatch-chip {
  background: #20222c;
  border-color: #464a60;
  color: #f4f5f9;
}

html[data-theme="dark"] .color-swatch-chip:hover {
  border-color: #e8a6bb;
}

html[data-theme="dark"] .color-swatch-chip.active {
  border-color: #e8a6bb;
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.35);
}

html[data-theme="dark"] .brief-preview-item {
  background: #20222c;
  border-color: #464a60;
}

html[data-theme="dark"] .brief-preview-badge {
  background: rgba(120, 156, 196, 0.2);
  color: #a8c3de;
  border-color: rgba(120, 156, 196, 0.4);
}

html[data-theme="dark"] .brief-preview-meta {
  color: #d5dae6;
}

html[data-theme="dark"] .brief-preview-notes {
  background: #292c39;
  color: #e6e8f0;
  border: 1px solid #464a60;
}

html[data-theme="dark"] .bespoke-request-card {
  background: #222530;
  border-color: #3d4154;
}

html[data-theme="dark"] .active-focus-upload {
  border-color: #e8a6bb !important;
  background: rgba(251, 113, 133, 0.08) !important;
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.25);
}

html[data-theme="dark"] .preset-card.active {
  border-color: var(--accent-line);
  background: rgba(232, 166, 187, 0.18);
  box-shadow: 0 0 0 1px var(--accent-line);
}

html[data-theme="dark"] .upload-zone {
  background: #292c39;
  border-color: #40424a;
}

html[data-theme="dark"] .upload-zone.dragover {
  border-color: var(--accent-line);
  background: rgba(232, 166, 187, 0.18);
}

/* ============================================================================
   CARD PREVIEW ZOOM & SHORTCUTS HELP MODAL (VIEW ONLY)
   ============================================================================ */
.preview-zoom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.zoom-controls-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 3px 5px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.btn-zoom {
  min-height: 36px;
  min-width: 36px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-zoom:hover {
  background: var(--bg-surface);
  border-color: var(--border-color);
}

.btn-zoom:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.btn-zoom.active {
  background: var(--primary-burgundy);
  color: #ffffff;
}

.btn-zoom-action {
  font-size: 12px;
  font-weight: 800;
}

.zoom-level-badge {
  min-width: 50px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  padding: 2px 6px;
  user-select: none;
}

.btn-shortcuts-help {
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  cursor: pointer;
}

.btn-shortcuts-help:hover {
  border-color: var(--primary-burgundy);
  background: var(--bg-subtle);
}

/* Shortcuts Modal Dialog */
.shortcuts-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.shortcuts-modal-backdrop.hidden {
  display: none !important;
}

.shortcuts-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 540px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: modalFadeIn 0.18s ease-out;
  overflow: hidden;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.shortcuts-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.shortcuts-modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shortcuts-icon-badge {
  font-size: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shortcuts-modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
}

.shortcuts-modal-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 2px 0 0;
}

.shortcuts-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.shortcuts-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.shortcuts-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shortcuts-section h4 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcuts-table td {
  padding: 6px 4px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

.shortcuts-table tr:last-child td {
  border-bottom: none;
}

.shortcuts-table td:first-child {
  width: 140px;
  white-space: nowrap;
}

kbd {
  display: inline-block;
  padding: 3px 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.shortcuts-notice-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 4px;
}

.shortcuts-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  background: var(--bg-surface);
}

/* Dark Mode Overrides for Zoom & Shortcuts */
html[data-theme="dark"] .preview-zoom-bar {
  background: #2a2d42;
  border-color: #50556e;
}

html[data-theme="dark"] .zoom-controls-group {
  background: #2f3242;
  border-color: #50556e;
}

html[data-theme="dark"] .btn-zoom {
  color: #d5dae6;
}

html[data-theme="dark"] .btn-zoom:hover {
  background: #2a2d42;
  border-color: #676e8d;
  color: #e6e8f0;
}

html[data-theme="dark"] .btn-zoom.active {
  background: #bd4a6f;
  color: #ffffff;
}

html[data-theme="dark"] .btn-shortcuts-help {
  background: #2f3242;
  border-color: #50556e;
  color: #e6e8f0;
}

html[data-theme="dark"] .btn-shortcuts-help:hover {
  border-color: #bd4a6f;
}

html[data-theme="dark"] .shortcuts-modal-card {
  background: #2a2d42;
  border-color: #50556e;
}

html[data-theme="dark"] .shortcuts-modal-header,
html[data-theme="dark"] .shortcuts-modal-footer {
  background: #2a2d42;
  border-color: #50556e;
}

html[data-theme="dark"] .shortcuts-icon-badge {
  background: #2f3242;
  border-color: #50556e;
}

html[data-theme="dark"] kbd {
  background: #2f3242;
  border-color: #676e8d;
  color: #e6e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .shortcuts-notice-box {
  background: #2f3242;
  border-color: #50556e;
  color: #d5dae6;
}

/* Honest Local Prototype Simulation & Technical Boundaries Callouts */
.local-simulation-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  margin: 10px 0 14px;
}

.local-simulation-callout .ui-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: #7a1f3d;
}

.local-simulation-callout .callout-text {
  flex: 1;
}

.local-simulation-callout.boundary-callout {
  margin-top: 10px;
  margin-bottom: 14px;
}

.local-simulation-callout.boundary-callout .ui-icon {
  color: #34476a;
}

.boundary-callout ul {
  margin: 6px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.boundary-callout li {
  font-size: 12px;
  line-height: 1.4;
}

/* Dark Mode Callout Overrides */
html[data-theme="dark"] .local-simulation-callout {
  background: #292c39;
  border-color: #464a60;
  color: #d5dae6;
}

html[data-theme="dark"] .local-simulation-callout .ui-icon {
  color: #a9c8e6;
}

html[data-theme="dark"] .local-simulation-callout.boundary-callout .ui-icon {
  color: #a8c3de;
}

/* Staff Reusable Local Template Catalog Box */
.staff-template-catalog-box {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.template-catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.template-catalog-header strong {
  font-size: 13.5px;
  color: var(--text-main);
}

.catalog-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(82, 97, 73, 0.10);
  color: #7a1f3d;
  margin-left: 8px;
}

.template-catalog-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.catalog-save-status {
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #426b49;
}

html[data-theme="dark"] .staff-template-catalog-box {
  background: #292c39;
  border-color: #464a60;
}

html[data-theme="dark"] .catalog-badge {
  background: rgba(184, 195, 169, 0.12);
  color: #a9c8e6;
}

html[data-theme="dark"] .catalog-save-status {
  color: #9fd6bf;
}



@media (max-width: 480px) {
  .preview-quick-actions {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 16px;
  }
}

/* ==========================================================================
   COMPACT HEADER, PINNED PREVIEW DOWNLOADS, PDF IMPORT REVIEW, EXPORT OPTIONS
   ========================================================================== */
.preview-quick-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

@media (min-width: 1081px) {
  .app-header {
    padding-top: 10px;
  }

  .header-top-row {
    padding: 6px 24px;
    gap: 16px;
  }

  .brand-home-btn {
    min-height: 48px;
    padding: 4px 12px;
  }

  .wcu-logo-lockup {
    height: 40px;
  }

  .header-mode-row {
    padding: 6px 24px;
    flex-wrap: nowrap;
  }

  .mode-status-left {
    flex: 1 1 0;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .brand-subtitle {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mode-switcher-pills {
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
}

/* The font status badge is informational: hide it before it can force the header onto extra lines */
@media (max-width: 1560px) {
  .font-status-pill,
  .mode-sep {
    display: none;
  }
}

@media (max-height: 760px) and (min-width: 1081px) {
  .mode-status-left {
    display: none;
  }

  .header-mode-row {
    justify-content: flex-end;
  }
}

@media (max-width: 600px) {
  .mode-status-left {
    display: none;
  }

  .header-mode-row {
    padding: 8px 14px;
  }

  /* Phones: one row of toggles (icons for theme), and the header scrolls away instead of covering a third of the screen */
  .app-header {
    position: static;
  }

  .mode-switcher-pills {
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .mode-seg-btn .seg-desc {
    display: none;
  }

  .theme-seg-btn {
    padding: 6px 12px;
  }

  .theme-seg-btn .seg-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

.control-label-static {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field-hint.is-warning {
  color: var(--status-warn-text);
  background: var(--status-warn-bg);
  border: 1px solid var(--status-warn-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.pdf-review {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.pdf-review.hidden {
  display: none;
}

.pdf-review-head p {
  margin: 4px 0 0;
}

.pdf-review-scroll {
  margin: 12px 0;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.pdf-review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pdf-review-table th,
.pdf-review-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.pdf-review-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-subtle);
  font-size: 12px;
  z-index: 1;
}

.pdf-review-table tr.has-flags {
  background: var(--status-warn-bg);
}

.pdf-review-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.pdf-review-table .input-text {
  width: 100%;
  min-height: 40px;
}

.pdf-review-count {
  max-width: 72px;
}

.pdf-review-flags {
  font-size: 12px;
  color: var(--status-warn-text);
  min-width: 140px;
}

.pdf-review-flags.is-ok {
  color: var(--status-ready-text);
}

.pdf-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 600px) {
  .pdf-review-table thead {
    display: none;
  }

  .pdf-review-table tr {
    display: grid;
    grid-template-columns: auto 1fr 84px;
    gap: 6px 8px;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
  }

  .pdf-review-table td {
    border: none;
    padding: 0;
  }

  .pdf-review-flags {
    grid-column: 1 / -1;
  }
}

.export-options .controls-grid-2 {
  align-items: start;
}

/* ==========================================================================
   REDESIGN: icons, tool rail, grouped text inspector, controls, canvas stage
   Light = paper, stone, oxblood and sage. Dark = warm charcoal and muted natural accents.
   ========================================================================== */
.ui-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

body {
  background: var(--bg-app);
  color: var(--text-main);
}

/* ---- Buttons: clear primary / secondary / quiet hierarchy ---- */
.btn {
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.005em;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---- Header: logo is the anchor ---- */
.header-card {
  border-radius: 16px;
  border-color: var(--border-color);
  background: var(--bg-surface);
}

@media (min-width: 1081px) {
  .wcu-logo-lockup {
    height: 46px;
  }

  .brand-home-btn {
    min-height: 54px;
  }
}

.step-tab.active {
  color: var(--accent-text);
}

.step-tab.active::after {
  background: var(--gold);
  height: 3px;
  border-radius: 3px;
}

.step-tab .step-num {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.step-tab.active .step-num {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--on-accent);
}

.btn-cta-pill {
  background: var(--accent-primary);
  color: var(--on-accent);
  box-shadow: 0 4px 14px rgba(124, 25, 54, 0.22);
}

html[data-theme="dark"] .btn-cta-pill {
  box-shadow: 0 4px 14px rgba(232, 166, 187, 0.28);
}

.step-badge {
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold);
}

/* ---- Layout: bigger canvas, tool rail on the left ---- */
@media (min-width: 1081px) {
  .workspace-grid {
    grid-template-columns: minmax(470px, 0.82fr) minmax(580px, 1.18fr);
    gap: 28px;
  }
}

.studio-layout {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.studio-sections {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.tool-rail {
  position: sticky;
  top: var(--header-offset, 140px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.rail-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.rail-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.rail-btn.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-border);
}

.rail-btn.active::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--gold);
}

.rail-btn-secondary {
  margin-top: 6px;
  border-top: 1px dashed var(--border-strong);
  border-radius: 0 0 12px 12px;
  padding-top: 12px;
  color: var(--text-muted);
}

.tool-section {
  scroll-margin-top: calc(var(--header-offset, 140px) + 8px);
  min-width: 0;
}

.tool-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.tool-head h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.tool-head .section-help {
  margin: 4px 0 0;
}

.tool-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
}

.tool-head-plain {
  padding: 0 4px;
}

.card-tool,
.staff-tool {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-tool > .tool-head,
.staff-tool > .tool-head {
  margin-bottom: 0;
}

.optional-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---- Cards ---- */
.card-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.badge-accent {
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold);
}

.step-eyebrow {
  color: var(--accent-text);
}

/* ---- Inputs ---- */
.input-text,
.input-select {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
}

.input-text:focus,
.input-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

input[type="range"] {
  accent-color: var(--accent-primary);
}

.control-group > label,
.control-label-static {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ---- Switches ---- */
input[type="checkbox"].switch-input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  min-width: 44px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-hover);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

input[type="checkbox"].switch-input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease;
}

input[type="checkbox"].switch-input:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

input[type="checkbox"].switch-input:checked::after {
  transform: translateX(18px);
}

input[type="checkbox"].switch-input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.checkbox-label,
.toggle-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

/* ---- Segmented controls ---- */
.seg-group {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.seg-choice {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.seg-choice:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.seg-choice.active {
  background: var(--bg-surface);
  color: var(--accent-text);
  border-color: var(--accent-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---- Text inspector ---- */
.text-inspector .inspector-tabs {
  margin: 14px 0;
}

.text-inspector .inspector-tabs .seg-choice {
  min-height: 46px;
  font-size: 14px;
}

.inspector-pane.hidden {
  display: none;
}

.inspector-group {
  margin: 0;
  padding: 16px 0 4px;
  border: 0;
  border-top: 1px solid var(--border-color);
  min-width: 0;
}

.inspector-group > legend {
  float: left;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.inspector-group > legend + * {
  clear: both;
}

.inspector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px 16px;
  align-items: start;
  clear: both;
}

.inspector-group .control-group {
  margin: 0;
  min-width: 0;
}

.inspector-group > .control-group + .control-group {
  margin-top: 12px;
}

.inspector-family {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  clear: both;
}

.family-chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 13px;
}

.family-note {
  color: var(--text-muted);
  font-size: 12px;
}

.adm-enable-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0 4px;
}

.text-inspector .quick-live-guest-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

.text-inspector .quick-live-guest-card .field-group-header {
  display: none;
}

.text-inspector .quick-live-guest-card .section-meta {
  font-size: 12px;
}

.align-btn-group {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.btn-align-icon {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.btn-align-icon.active {
  background: var(--bg-surface);
  color: var(--accent-text);
  border-color: var(--accent-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---- Preview column: neutral stage, caption outside the frame ---- */
.preview-card-sticky {
  border-radius: 20px;
  box-shadow: var(--shadow-preview);
}

.canvas-stage-wrapper {
  background-color: var(--bg-stage);
  background-image: radial-gradient(color-mix(in srgb, var(--text-main) 7%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
}

#invitationCanvas {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.canvas-drag-hint {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
}

.zoom-controls-group {
  border-radius: 12px;
}

.btn-zoom.active {
  background: var(--accent-primary);
  color: var(--on-accent);
}

.zoom-level-badge {
  color: var(--text-main);
}

/* ---- Phone & tablet: rail becomes a chip row ---- */
@media (max-width: 1080px) {
  .studio-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .tool-rail {
    position: static;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding: 6px;
    border-radius: 16px;
    scrollbar-width: none;
  }

  .tool-rail::-webkit-scrollbar {
    display: none;
  }

  .rail-btn {
    flex: 1 0 auto;
    flex-direction: row;
    gap: 8px;
    min-height: 48px;
    padding: 8px 16px;
  }

  .rail-btn.active::before {
    display: none;
  }

  .rail-btn-secondary {
    margin-top: 0;
    border-top: 1px solid transparent;
    border-radius: 12px;
    padding-top: 8px;
  }

  .tool-section {
    scroll-margin-top: 12px;
  }
}

@media (max-width: 600px) {
  .tool-head-icon {
    width: 38px;
    height: 38px;
  }

  .inspector-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .text-inspector .inspector-tabs .seg-choice span {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Simulation notices use the restrained sage accent */
.simulation-tag {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.local-simulation-callout .ui-icon {
  color: var(--gold);
}

/* ---- Disclosures: vector chevron, hint under the title ---- */
.disclosure-group {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.disclosure-summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  padding: 14px 16px;
}

.disclosure-summary::before {
  content: "";
  grid-row: 1 / span 2;
  width: 8px;
  height: 8px;
  margin: 0 0 0 4px;
  border-right: 2px solid var(--accent-text);
  border-bottom: 2px solid var(--accent-text);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.disclosure-group[open] > .disclosure-summary::before {
  transform: rotate(45deg);
}

.disclosure-summary > span:first-child {
  grid-column: 2;
  font-weight: 700;
}

.disclosure-hint {
  grid-column: 2;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.inspector-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* ---- Tidy leftovers: neutral switch labels, chips that fit on phones ---- */
.text-inspector .field-badge,
.text-inspector .badge-name,
.text-inspector .badge-adm {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

.adm-enable-row .section-meta {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

@media (max-width: 600px) {
  .tool-rail {
    gap: 4px;
    padding: 5px;
  }

  .rail-btn {
    flex: 1 1 0;
    min-width: 0;
    gap: 6px;
    padding: 8px 6px;
    font-size: 12.5px;
  }

  .rail-btn .ui-icon {
    width: 18px;
    height: 18px;
  }
}

/* Tablet & phone: the preview is not sticky here, so the tall header scrolls away instead of pinning */
@media (max-width: 1080px) {
  .app-header {
    position: static;
  }
}

.inspector-grid > .sizing-locks-row {
  grid-column: 1 / -1;
  margin: 0;
}

.inspector-group .field-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-muted);
}

.disclosure-hint {
  justify-self: start;
  text-align: left;
}

/* Beat the older per-theme badge rules: inspector labels are plain text, not badges */
html[data-theme] .text-inspector .field-badge,
html[data-theme] .text-inspector .field-badge.badge-name,
html[data-theme] .text-inspector .field-badge.badge-adm,
html[data-theme] .adm-enable-row .section-meta {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  color: var(--text-main);
  text-transform: none;
  letter-spacing: 0;
}

html[data-theme] .adm-enable-row .section-meta {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}

/* Natural palette: secondary rate labels are informational, not gold badges. */
.pricing-rate-status,
html[data-theme="dark"] .pricing-rate-status {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: var(--gold-border);
}
html[data-theme="dark"] .pricing-tier-badge {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-border);
}
html[data-theme="dark"] .simulation-tag,
html[data-theme="dark"] .badge-accent {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: var(--gold-border);
}
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-outline {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}
html[data-theme="dark"] .btn-cta-pill {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* ==========================================================================
   VENTURA PALETTE (replaces Lake & Stone): cool light surfaces, deep navy text,
   burgundy accent, restrained blush and pale-blue gradients. Derived from the
   venturavisualsug.com stylesheet (ink #2A2D42, burgundy #7A1F3D, stock #F9F9FB / #14161F).
   Status chips are neutral tinted chips with a dot: no amber, brown or gold.
   ========================================================================== */
:root {
  --bg-app: #f4f5f9;
  --bg-surface: #ffffff;
  --bg-subtle: #f7f8fb;
  --bg-hover: #eceef4;
  --bg-stage: #e3e6ef;
  --border-color: #dcdce4;
  --border-strong: #a9adc0;
  --text-main: #2a2d42;
  --text-secondary: #41445c;
  --text-muted: #555971;
  --accent-primary: #7a1f3d;
  --accent-hover: #5f1830;
  --accent-soft: #f6e9ee;
  --accent-border: #e1bccb;
  --accent-text: #7a1f3d;
  --on-accent: #ffffff;
  --focus-ring: #7a1f3d;
  --coral: #a8395c;
  --coral-soft: #f6e9ee;
  --gold: #a8395c;
  --gold-soft: #f6e9ee;
  --gold-border: #e1bccb;
  --navy-accent: #2a2d42;
  --brand-navy: #2a2d42;
  --status-ready-bg: #e3f0ea;  --status-ready-text: #1f5a45;  --status-ready-border: #b6d6c8;
  --status-warn-bg: #e6f0f8;   --status-warn-text: #1d4f73;    --status-warn-border: #b9d3e8;
  --status-danger-bg: #f8e6ec; --status-danger-text: #8a1d3d;  --status-danger-border: #e6bccb;
  --status-info-bg: #e6f0f8;   --status-info-text: #1d4f73;    --status-info-border: #b9d3e8;
  --shadow-header: 0 4px 20px rgba(42, 45, 66, 0.06), 0 1px 2px rgba(42, 45, 66, 0.04);
  --shadow-card: 0 2px 12px rgba(42, 45, 66, 0.05), 0 1px 2px rgba(42, 45, 66, 0.03);
  --shadow-preview: 0 10px 30px rgba(42, 45, 66, 0.10);
}

html[data-theme="dark"] {
  --bg-app: #14161f;
  --bg-surface: #1e2130;
  --bg-subtle: #252b40;
  --bg-hover: #2d3450;
  --bg-stage: #0f1118;
  --border-color: #2c3042;
  --border-strong: #4d5575;
  --text-main: #f0f0f4;
  --text-secondary: #d5dae6;
  --text-muted: #a9adc0;
  --accent-primary: #a8395c;
  --accent-hover: #bd4a6f;
  --accent-soft: rgba(232, 166, 187, 0.14);
  --accent-border: rgba(232, 166, 187, 0.38);
  --accent-text: #efb3c6;
  --accent-line: #e8a6bb;
  --on-accent: #ffffff;
  --focus-ring: #efb3c6;
  --coral: #e08aa6;
  --coral-soft: rgba(224, 138, 166, 0.14);
  --gold: #e08aa6;
  --gold-soft: rgba(224, 138, 166, 0.14);
  --gold-border: rgba(224, 138, 166, 0.38);
  --navy-accent: #252b40;
  --brand-navy: #d5dae6;
  --status-ready-bg: #1f3a30;  --status-ready-text: #9fd6bf;  --status-ready-border: #2f5a48;
  --status-warn-bg: #1f2c40;   --status-warn-text: #a9c8e6;    --status-warn-border: #34476a;
  --status-danger-bg: #40222d; --status-danger-text: #f0a8bb;  --status-danger-border: #6a3a4a;
  --status-info-bg: #1f2c40;   --status-info-text: #a9c8e6;    --status-info-border: #34476a;
  --shadow-header: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.25);
  --shadow-preview: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Restrained blush and pale-blue wash behind the app (light only) */
html:not([data-theme="dark"]) body {
  background-image:
    radial-gradient(60rem 28rem at 92% -4%, #f6eef4 0, transparent 70%),
    radial-gradient(52rem 26rem at -6% 8%, #e8f0f8 0, transparent 70%);
  background-attachment: fixed;
}

/* Neutral status chip for the card-brief preview badge (replaces the amber chip) */
.brief-preview-badge,
html[data-theme="dark"] .brief-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--status-info-bg);
  color: var(--status-info-text);
  border: 1px solid var(--status-info-border);
}
.brief-preview-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ==========================================================================
   THREE-PANE WORKSPACE (wide screens, Step 1): tools | card preview | settings
   Below 1280px the existing two-column / stacked layouts apply unchanged.
   ========================================================================== */
@media (min-width: 1280px) {
  .workspace-grid[data-step="staff"] {
    grid-template-columns: 84px minmax(0, 1.08fr) minmax(370px, 415px);
    grid-template-rows: auto 1fr;
    gap: 0 22px;
  }
  .workspace-grid[data-step="staff"] .controls-column,
  .workspace-grid[data-step="staff"] #panelStaff,
  .workspace-grid[data-step="staff"] .studio-layout {
    display: contents;
  }
  .workspace-grid[data-step="staff"] #panelStaff.hidden { display: none; }
  .workspace-grid[data-step="staff"] .tool-rail {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
  }
  .workspace-grid[data-step="staff"] .preview-column {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .workspace-grid[data-step="staff"] #panelStaff > .panel-header {
    grid-column: 3;
    grid-row: 1;
    margin-bottom: 14px;
  }
  .workspace-grid[data-step="staff"] .studio-sections {
    grid-column: 3;
    grid-row: 2;
  }
  .workspace-grid[data-step="staff"] .preview-card-sticky {
    max-height: calc(100vh - var(--header-offset, 140px) - 16px);
  }
}

/* Restrained coral: only the active-tool marker and the selection outline on the card */
.rail-btn.active::before { background: var(--coral); }

/* Badges and tags are neutral tinted chips; coral is kept for the active-tool marker and the card selection outline */
.badge-accent, .simulation-tag, .step-badge, .optional-tag,
html[data-theme="dark"] .badge-accent, html[data-theme="dark"] .simulation-tag,
html[data-theme="dark"] .step-badge, html[data-theme="dark"] .optional-tag {
  background: var(--status-info-bg);
  color: var(--status-info-text);
  border: 1px solid var(--status-info-border);
}

html[data-theme="dark"] .preview-zoom-bar,
html[data-theme="dark"] .preview-guest-bar,
html[data-theme="dark"] .zoom-controls-group {
  background: var(--bg-subtle);
  border-color: var(--border-color);
}

/* ==========================================================================
   Tool switching: the settings pane shows only the selected tool
   ========================================================================== */
.studio-sections[data-tool="toolCard"] > .tool-section:not(#toolCard),
.studio-sections[data-tool="toolText"] > .tool-section:not(#toolText),
.studio-sections[data-tool="toolQr"] > .tool-section:not(#toolQr),
.studio-sections[data-tool="toolStaff"] > .tool-section:not(#toolStaff) {
  display: none;
}

/* ==========================================================================
   Logo: clear and comfortably spaced in the toolbar
   ========================================================================== */
.brand-home-btn {
  padding: 18px 22px;
  min-height: 92px;
}
.wcu-logo-lockup {
  height: 58px;
}
@media (max-width: 600px) {
  .brand-home-btn { padding: 14px 16px; min-height: 80px; }
  .wcu-logo-lockup { height: 52px; }
}

/* Help button */
.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.help-btn:hover { background: var(--bg-hover); }
.help-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.help-modal-card { max-width: 640px; }
.help-modal-body { display: flex; flex-direction: column; gap: 16px; }
.help-topic h4 { margin: 0 0 4px; font-size: 15px; color: var(--text-main); }
.help-topic p, .help-topic li { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.help-topic ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.help-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Less text on working screens: detailed guidance lives in Help
   ========================================================================== */
.section-help,
.tool-head p,
.simulation-tag,
#qrBackendNotice {
  display: none;
}
.tool-head { align-items: center; }

/* Short screens keep the header compact so the card stays large */
@media (max-height: 760px) {
  .brand-home-btn { padding: 8px 18px; min-height: 66px; }
  .wcu-logo-lockup { height: 50px; }
}
@media (max-height: 760px) {
  .brand-home-btn { padding: 4px 16px; min-height: 60px; }
  .wcu-logo-lockup { height: 48px; }
  .header-top-row { padding-top: 8px; padding-bottom: 8px; }
  .header-mode-row { padding-top: 6px; padding-bottom: 6px; }
}
@media (max-height: 760px) {
  .header-top-row { padding-top: 4px; padding-bottom: 4px; }
  .header-mode-row { padding-top: 4px; padding-bottom: 4px; }
}

/* ==========================================================================
   PROJECT BAR: couple's names as the title, quiet secondary label, "Preview" badge
   ========================================================================== */
.header-mode-row {
  background: linear-gradient(100deg, #f8eff4 0%, #f4f6fb 48%, #e9f1fa 100%);
  border-top: 1px solid var(--border-color);
}
html[data-theme="dark"] .header-mode-row {
  background: linear-gradient(100deg, rgba(168, 57, 92, 0.14) 0%, #1e2130 46%, rgba(52, 71, 106, 0.30) 100%);
}

.project-bar {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 12px;
}
.project-names {
  min-width: 0;
  max-width: 100%;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-kind {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.preview-badge {
  align-self: center;
  padding: 2px 10px;
  border: 1px solid var(--status-info-border);
  border-radius: 999px;
  background: var(--status-info-bg);
  color: var(--status-info-text);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
}
/* Font status: silent when fine (details live in Help); a real failure always stays visible */
.font-status-pill.is-ok { display: none; }
.font-status-pill.warn { display: inline-flex !important; align-self: center; flex-basis: auto; }
.help-diagnostic {
  margin-top: 6px !important;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-subtle);
  font-size: 13px !important;
}

/* Short screens: keep the bar on one compact line, title visible */
@media (max-height: 760px) and (min-width: 1081px) {
  .project-bar { display: flex !important; flex-wrap: nowrap; }
  .project-names { font-size: 15px; }
  .header-mode-row { justify-content: space-between !important; }
}

/* Phones: title on its own row (up to two lines, never overflowing), toggles below */
@media (max-width: 600px) {
  .project-bar { display: flex !important; flex: 1 1 100%; gap: 2px 10px; }
  .project-names {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
    font-size: 16px;
  }
  .header-mode-row { row-gap: 8px; }
}

/* Phones: Help becomes an icon button so the theme and mode switches fit on one row */
@media (max-width: 600px) {
  .help-btn { padding: 0; width: 44px; justify-content: center; }
  .help-btn span { display: none; }
  .header-mode-row .mode-switcher-pills { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 600px) {
  .header-mode-row .mode-switcher-pills { display: flex; width: 100%; }
  .header-mode-row .appearance-control { flex: 1 1 0; min-width: 0; }
  .header-mode-row .appearance-control .theme-segmented-track { width: 100%; }
  .header-mode-row .mode-switcher-pills > :last-child { flex: 1 1 100%; }
}

/* ==========================================================================
   PHONE FIRST SCREEN: a compact header so the card is the first thing you see.
   Row 1 logo + steps, row 2 title, row 3 Help / theme / Staff-Client.
   Less-frequent view controls sit behind the "View options" button, and the
   tool rail stays reachable at the bottom of the screen.
   ========================================================================== */
.step-label-short { display: none; }
.preview-options-btn { display: none; }

@media (max-width: 600px) {
  html { scroll-padding-bottom: 88px; }

  .app-header { padding: 6px 8px 0; }
  .header-top-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 2px 6px 2px 2px;
  }
  .brand-group { flex: 0 0 auto; }
  .brand-home-btn { padding: 4px 8px; min-height: 48px; }
  .wcu-logo-lockup { height: 40px; width: auto; }
  .header-nav-cluster { flex: 1 1 0; min-width: 0; width: auto; }
  .step-tabs { display: flex; width: 100%; min-width: 0; gap: 2px; justify-content: flex-end; }
  .step-tab {
    position: relative;
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
    gap: 6px;
    justify-content: center;
  }
  .step-tab.active { flex: 1 1 auto; min-width: 44px; }
  .step-tab .step-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .step-tab.active .step-label-short {
    display: inline;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
  }
  .step-tab .step-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    line-height: 0;
    background: var(--accent-primary) !important;
    border: 2px solid var(--bg-surface) !important;
    box-sizing: content-box;
  }

  .header-mode-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    padding: 4px 8px 8px;
  }
  .project-bar { flex: 1 1 100%; flex-wrap: nowrap; align-items: center; gap: 8px; }
  .project-names {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
  }
  .project-kind { display: none; }
  .preview-badge { flex: 0 0 auto; }
  .header-mode-row .mode-switcher-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 8px;
    width: 100%;
  }
  .header-mode-row .appearance-control { flex: 0 0 auto; width: auto; }
  .header-mode-row .segmented-track { padding: 2px; }
  .header-mode-row .appearance-control .theme-segmented-track { width: auto; }
  .header-mode-row .mode-switcher-pills > :last-child { flex: 0 0 auto; width: auto; }
  .header-mode-row .mode-segmented-track { width: auto; }
  .theme-seg-btn { min-width: 40px; min-height: 44px; padding: 0 8px; }
  .mode-seg-btn { min-height: 44px; padding: 0 12px; }
  .mode-seg-btn .seg-indicator { display: none; }

  /* Card first: it sits directly under the header, with its controls beneath it */
  .workspace-grid { padding: 8px 8px 96px; gap: 12px; }
  .preview-card-sticky { border-radius: 16px; }
  .canvas-stage-wrapper { order: 1; padding: 8px; }
  .preview-guest-bar { order: 2; }
  .preview-toolbar { order: 3; }
  .preview-zoom-bar { order: 4; }
  .canvas-drag-hint { display: none; }
  .preview-diagnostics { order: 6; }
  .preview-quick-actions { order: 7; }
  .preview-toolbar-left { display: none; }
  #invitationCanvas { max-height: max(220px, calc(100svh - 300px)); max-width: 100%; }

  .preview-options-btn { display: inline-flex; flex: 0 0 auto; }
  .preview-options-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-border); }
  .preview-card-sticky:not(.options-open) .preview-toolbar,
  .preview-card-sticky:not(.options-open) .preview-zoom-bar { display: none; }

  /* The tool rail stays reachable at the bottom of the screen */
  .workspace-grid[data-step="staff"] .tool-rail {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    z-index: 60;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 18px rgba(20, 22, 31, 0.10);
  }
  .workspace-grid[data-step="staff"] .rail-btn { flex-direction: column; gap: 2px; min-height: 52px; font-size: 12px; }
  .workspace-grid[data-step="staff"] .rail-btn.active::before { display: none; }
}

/* Very narrow phones: numbers only in the step tabs (full names stay in the accessible name) */
@media (max-width: 350px) {
  .step-tab.active .step-label-short { display: none; }
  .step-tab.active { flex: 0 0 auto; }
}

/* ==========================================================================
   PHONE BOTTOM SHEET: settings for the selected tool open above the tool rail,
   so the card stays in view while you edit.
   ========================================================================== */
.sheet-bar { display: none; }

@media (max-width: 600px) {
  .workspace-grid {
    --rail-h: calc(68px + env(safe-area-inset-bottom, 0px));
    --sheet-h: clamp(240px, 40svh, 380px);
  }
  .workspace-grid[data-step="staff"] .studio-sections { display: none; }
  .workspace-grid[data-step="staff"][data-sheet="open"] .studio-sections {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--rail-h);
    height: var(--sheet-h);
    z-index: 55;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 12px 16px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 28px rgba(20, 22, 31, 0.16);
  }
  .workspace-grid[data-step="staff"][data-sheet="open"] .sheet-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 2;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin: 0 -12px 4px;
    padding: 10px 8px 0 16px;
    background: var(--bg-surface);
  }
  .sheet-grabber {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--border-strong, var(--border-color));
  }
  .sheet-title { font-size: 15px; font-weight: 800; color: var(--text-main); }
  .sheet-title:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
  .sheet-close-btn { width: 44px; height: 44px; }
  /* the sheet repeats the tool name, so the section's own heading row is redundant here */
  .workspace-grid[data-step="staff"][data-sheet="open"] .tool-head { display: none; }

  /* With the sheet open the card gets the room above it */
  .workspace-grid[data-step="staff"][data-sheet="open"] #invitationCanvas {
    max-height: max(140px, calc(100svh - var(--sheet-h) - var(--rail-h) - 28px));
  }
  .workspace-grid[data-step="staff"][data-sheet="open"] { padding-bottom: calc(var(--sheet-h) + var(--rail-h) + 16px); }
  html:has(.workspace-grid[data-sheet="open"]) { scroll-padding-bottom: calc(clamp(240px, 40svh, 380px) + 92px); }
}

/* ==========================================================================
   CLIENT LINK BAR (labelled unavailable: no backend exists to make a real link)
   ========================================================================== */
.client-link-bar {
  max-width: 1540px;
  margin: 12px auto 0;
  padding: 0 28px;
}
.client-link-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.client-link-head { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.client-link-title { font-size: 14px; color: var(--text-main); }
.client-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-main);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.client-link-chip:hover { background: var(--bg-hover); }
.client-link-chip[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }
.client-link-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex: 0 0 auto; }
.client-link-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.client-link-actions .btn { min-height: 40px; }
#copyGuestLinkBtn[aria-disabled="true"] {
  border-style: dashed;
  color: var(--text-secondary);
  cursor: not-allowed;
}
.client-link-feedback { flex: 1 1 100%; margin: 0; font-size: 13px; color: var(--text-secondary); }
.client-link-feedback:empty { display: none; }
.client-link-why {
  flex: 1 1 100%;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm, 8px);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.client-link-why.hidden { display: none; }
.client-link-why p { margin: 0 0 6px; }
.client-link-why-title { font-weight: 700; color: var(--text-main); }
.client-link-why ul { margin: 0 0 8px; padding-left: 20px; }
.client-link-why li { margin-bottom: 4px; }

/* Guided folds: always open on wider screens (summary hidden); folded on phones */
details.fold > summary { list-style: none; cursor: pointer; font-weight: 700; color: var(--accent-text); }
details.fold > summary::-webkit-details-marker { display: none; }
@media (min-width: 601px) {
  details.fold > summary { display: none; }
}
.back-to-list-btn { display: none; }

/* ==========================================================================
   STEP 2 ROWS: one tint per row card (the per-cell tints left patches in dark mode)
   ========================================================================== */
@media (max-width: 860px) {
  .guest-table td,
  html[data-theme="dark"] .guest-table td,
  html[data-theme="dark"] .guest-table tr:hover td,
  html[data-theme="dark"] .guest-table tr.active-preview-row td,
  html[data-theme="dark"] .guest-table tr.row-invalid td { background: transparent; }
  .guest-table tr.row-invalid { background: #fff5f7; border-color: #e3a9b8; }
  html[data-theme="dark"] .guest-table tr { background: #252b40; border-color: #3b4262; }
  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)), #252b40;
    border-color: rgba(232, 166, 187, 0.6);
  }
  html[data-theme="dark"] .guest-table tr.row-invalid {
    background: linear-gradient(rgba(190, 60, 90, 0.22), rgba(190, 60, 90, 0.22)), #252b40;
    border-color: rgba(238, 130, 160, 0.55);
  }
}

/* Dark appearance, Step 2: light, high-contrast entry fields on navy surfaces, rose focus */
html[data-theme="dark"] #panelClient .row-name-input,
html[data-theme="dark"] #panelClient .row-adm-input,
html[data-theme="dark"] #panelClient .row-notes-input,
html[data-theme="dark"] #panelClient .input-text,
html[data-theme="dark"] #panelClient .input-textarea {
  background: #eef0f7;
  color: #1f2233;
  border: 1px solid #a9adc0;
}
html[data-theme="dark"] #panelClient .row-name-input::placeholder,
html[data-theme="dark"] #panelClient .row-notes-input::placeholder,
html[data-theme="dark"] #panelClient .input-text::placeholder,
html[data-theme="dark"] #panelClient .input-textarea::placeholder { color: #565b74; opacity: 1; }
html[data-theme="dark"] #panelClient .row-name-input:focus-visible,
html[data-theme="dark"] #panelClient .row-adm-input:focus-visible,
html[data-theme="dark"] #panelClient .row-notes-input:focus-visible,
html[data-theme="dark"] #panelClient .input-text:focus-visible,
html[data-theme="dark"] #panelClient .input-textarea:focus-visible {
  outline: 2px solid #f1b8c9;
  outline-offset: 2px;
}
html[data-theme="dark"] .client-link-inner { background: #1e2130; border-color: #3b4262; }
html[data-theme="dark"] .client-link-why { background: #252b40; }

/* ==========================================================================
   PHONE STEP 2: guest list first, a roomy title, a slim link bar
   ========================================================================== */
@media (max-width: 600px) {
  /* Event name gets up to two lines in Step 2 (Step 1 keeps the card-first one-line title) */
  body:has(.workspace-grid[data-step="client"]) .project-names {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-size: 16px;
    line-height: 1.25;
  }

  .client-link-bar { margin: 6px 8px 0; padding: 0; }
  .client-link-inner { padding: 8px 10px; gap: 6px 8px; border-radius: 14px; }
  .client-link-head { flex: 1 1 100%; justify-content: space-between; flex-wrap: nowrap; }
  .client-link-chip { min-height: 44px; }
  .client-link-actions { flex: 1 1 100%; }
  .client-link-actions .btn { flex: 1 1 0; min-height: 44px; justify-content: center; }

  .workspace-grid[data-step="client"] .controls-column { order: 0; }
  .workspace-grid[data-step="client"] .preview-column { order: 0; }
  .workspace-grid[data-step="client"] .back-to-list-btn {
    display: flex;
    width: 100%;
    min-height: 44px;
    justify-content: center;
    margin-bottom: 8px;
  }

  #panelClient > .panel-header { flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 8px; }
  #panelClient .step-eyebrow { display: none; } /* the step tabs already show the step */
  #panelClient .panel-header h2 { font-size: 20px; line-height: 1.2; }
  #panelClient .header-btn-group { display: flex; gap: 8px; width: 100%; }
  #panelClient .header-btn-group .btn { flex: 1 1 0; min-height: 44px; justify-content: center; }
  #panelClient .card-section { padding: 12px; border-radius: 14px; }

  #panelClient .input-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
  #panelClient .mode-tab { min-height: 44px; padding: 0 6px; font-size: 14px; text-align: center; justify-content: center; }

  #panelClient .upload-zone { padding: 12px; }
  details.fold > summary { display: flex; align-items: center; min-height: 44px; }
  details.fold > summary::after { content: "Show"; margin-left: auto; font-weight: 600; color: var(--text-secondary); }
  details.fold[open] > summary::after { content: "Hide"; }
  details.fold { flex: 1 1 100%; width: 100%; }
  details.fold > span { display: block; font-size: 13px; line-height: 1.5; }
  #panelClient .upload-actions .btn { min-height: 44px; }
  #panelClient .sample-fold .sample-fetch-btn { margin: 0 6px 6px 0; }

  #panelClient .bulk-fix-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; }
  #panelClient .bulk-fix-actions .btn { min-width: 0; min-height: 44px; padding: 4px 6px; justify-content: center; text-align: center; line-height: 1.2; white-space: normal; }

  #panelClient .review-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  #panelClient .filter-pill { flex: 0 0 auto; min-height: 44px; scroll-snap-align: start; }

  .guest-table td.col-status { display: contents; }
  .guest-table td.col-status .row-status-dynamic { grid-column: 3; grid-row: 1; justify-self: end; }
  .guest-table td.col-status .row-notes-input { grid-column: 1 / -1; grid-row: 4; min-height: 44px; }
  .guest-table td.col-inc { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .guest-table td.col-inc input { width: 28px; height: 28px; }
  .guest-table td.col-name .row-name-input,
  .guest-table td.col-adm .row-adm-input { min-height: 44px; }
  .guest-table td.col-actions .btn { min-height: 44px; min-width: 44px; justify-content: center; }
  .review-footer-bar { flex-direction: column; align-items: stretch; }
  .review-footer-bar .btn { width: 100%; min-height: 48px; justify-content: center; }
  .panel-footer-bar { flex-direction: column; align-items: stretch; }
  .panel-footer-bar .btn { min-width: 0; width: 100%; min-height: 48px; white-space: normal; justify-content: center; text-align: center; }
  .seg-group[id$="WeightGroup"] { flex-wrap: wrap; }
  .seg-group[id$="WeightGroup"] .seg-choice { flex: 1 1 calc(50% - 2px); }
}

.guest-table input[type="checkbox"] { accent-color: var(--accent-primary); }

/* ==========================================================================
   CLIENT LINK BAR, simplified: one labelled (unavailable) control; details live in Help
   ========================================================================== */
.client-link-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 12px; padding: 8px 12px; }
.client-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-main);
  font: inherit;
  text-align: left;
  cursor: not-allowed;
}
.client-link-btn[aria-disabled="false"] { border-style: solid; cursor: pointer; }
.client-link-btn-main { font-weight: 700; font-size: 14px; }
.client-link-btn-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.client-link-btn:focus-visible, .client-view-switch button:focus-visible, .ink-swatch:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
html[data-theme="dark"] .client-link-btn:focus-visible, html[data-theme="dark"] .client-view-switch button:focus-visible, html[data-theme="dark"] .ink-swatch:focus-visible { outline-color: #f1b8c9; }

/* ==========================================================================
   TEXT COLOUR: quick colours + Custom picker
   ========================================================================== */
.ink-swatches { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 8px; }
.ink-swatch {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.ink-swatch-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-strong); box-sizing: border-box; }
.ink-swatch.selected { background: var(--accent-soft); }
.ink-swatch.selected .ink-swatch-dot { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--accent-primary); }
.ink-swatch[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.custom-colour-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.eyedropper-note { margin: 6px 0 0; }

/* ==========================================================================
   DARK APPEARANCE: light entry fields on the navy surfaces, everywhere you type or choose
   ========================================================================== */
html[data-theme="dark"] :is(.workspace-grid, .sheet-bar) :is(input[type="text"], input[type="number"], textarea, select):not(.sr-only) {
  background: #eef0f7;
  color: #1f2233;
  border-color: #a9adc0;
}
html[data-theme="dark"] :is(.workspace-grid, .sheet-bar) :is(input[type="text"], input[type="number"], textarea):not(.sr-only)::placeholder { color: #565b74; opacity: 1; }
html[data-theme="dark"] :is(.workspace-grid, .sheet-bar) :is(input[type="text"], input[type="number"], textarea, select):not(.sr-only):focus-visible {
  outline: 2px solid #f1b8c9;
  outline-offset: 2px;
}
html[data-theme="dark"] .ink-swatch-dot { border-color: #a9adc0; }
html[data-theme="dark"] .client-link-btn { background: #252b40; border-color: #6a7294; }

/* ==========================================================================
   PHONE: guest list / card preview switch, labelled step tabs, one-row link bar
   ========================================================================== */
.client-view-switch { display: none; }

@media (max-width: 600px) {
  html, body { overflow-x: clip; }

  /* Every step tab keeps a readable name under its number */
  .step-tabs { align-items: stretch; }
  .step-tab, .step-tab.active {
    flex: 1 1 0;
    min-width: 56px;
    min-height: 48px;
    flex-direction: column;
    gap: 1px;
    padding: 2px 2px;
    justify-content: center;
  }
  .step-tab .step-label-short,
  .step-tab.active .step-label-short {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
  }
  .step-tab .step-badge { top: 2px; right: 8px; }

  .client-link-inner { padding: 8px 10px; gap: 6px 8px; flex-wrap: wrap; }
  .client-link-btn { flex: 1 1 0; min-width: 0; flex-direction: column; align-items: flex-start; gap: 0; }
  .client-link-actions { display: none; }
  #exitClientLockBtn { flex: 0 0 auto; min-height: 44px; }
  .client-link-feedback { flex: 1 1 100%; }

  .workspace-grid[data-step="client"] .client-view-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
  }
  .client-view-switch button {
    min-height: 48px;
    padding: 0 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
  }
  .client-view-switch button[aria-pressed="true"] { background: var(--accent-primary); color: #ffffff; }
  .workspace-grid[data-step="client"][data-client-view="card"] .controls-column { display: none; }
  .workspace-grid[data-step="client"][data-client-view="list"] .preview-column { display: none; }
}

/* Narrow phones (320px): tabs size to their label so three labelled steps fit beside the logo */
@media (max-width: 600px) {
  .step-tab, .step-tab.active { flex: 1 1 auto; min-width: 48px; padding: 2px 0; }
  .step-tabs { gap: 2px; }
}
@media (max-width: 350px) {
  .brand-home-btn { padding: 4px 4px; }
}

/* Phones, Step 2: the switch already names the view, so the panel heading stays for screen readers only */
@media (max-width: 600px) {
  #panelClient > .panel-header h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .client-view-switch button { min-height: 44px; }
}

/* Phone sheet: text colours come first, right under the Guest name / Admission number tabs */
@media (max-width: 600px) {
  .inspector-pane:not(.hidden),
  #admissionControlsBody:not(.hidden) {
    display: flex;
    flex-direction: column;
  }
  .inspector-pane > .adm-enable-row { order: -2; }
  .inspector-colour { order: -1; border-top: 0; padding-top: 4px; }
}

/* Phone sheet: the preview-name / apply-scope block moves below the inspector so tabs and colours are on the first screen of the sheet */
@media (max-width: 600px) {
  #toolText.text-inspector { display: flex; flex-direction: column; }
  #toolText.text-inspector > .quick-live-guest-card { order: 10; margin-top: 16px; }
}

@media (max-width: 600px) {
  /* "Text colour" already names the group; keep the legend for screen readers only */
  .inspector-colour > legend {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}

/* ==========================================================================
   GUEST LINK: status, read-only link field + Copy, Shorten toggle
   ========================================================================== */
.client-link-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 14px; }
.guest-link-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.guest-link-title { margin: 0; font-size: 15px; font-weight: 800; color: var(--text-main); }
.guest-link-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  padding: 2px 10px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border-color);
}
#exitClientLockBtn { min-height: 44px; }
#simClientBanner[data-link-state="ready"] .client-link-chip-dot { background: #2f7d4f; }
#simClientBanner[data-link-state="loading"] .client-link-chip-dot { background: var(--accent-primary); animation: link-pulse 1s ease-in-out infinite; }
#simClientBanner[data-link-state="error"] .client-link-chip-dot { background: #b3261e; }
@keyframes link-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { #simClientBanner .client-link-chip-dot { animation: none !important; } }
.guest-link-row { display: flex; gap: 8px; align-items: stretch; }
.guest-link-field {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 12px; font: inherit; font-size: 14px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-surface); color: var(--text-main);
  text-overflow: ellipsis;
}
.guest-link-field::placeholder { color: var(--text-secondary); opacity: 1; }
#simClientBanner[data-link-state="ready"] .guest-link-field { border-color: var(--accent-border); }
.client-link-btn { justify-content: center; min-width: 88px; padding: 6px 18px; font-weight: 700; font-size: 14px; }
.client-link-btn[aria-disabled="false"] { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }
.client-link-retry {
  min-height: 44px; padding: 6px 14px; font: inherit; font-weight: 700; font-size: 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--accent-primary); background: transparent; color: var(--accent-text);
}
.client-link-retry.hidden { display: none; }
.guest-link-toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; width: fit-content; max-width: 100%; }
.guest-link-toggle-text { display: flex; flex-direction: column; font-size: 13px; color: var(--text-secondary); }
.guest-link-toggle-text strong { font-size: 14px; color: var(--text-main); }
.client-link-feedback { flex: none; }
.artwork-scope-note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.artwork-scope-note .link-btn-subtle { min-height: 44px; }
html[data-theme="dark"] input#guestLinkField { background: #f3f4f8; color: #2a2d42; border-color: #7b83a6; }
html[data-theme="dark"] input#guestLinkField::placeholder { color: #565b74; opacity: 1; }
html[data-theme="dark"] .guest-link-status { background: #252b40; border-color: #3b4262; color: #d9dcea; }
@media (max-width: 600px) {
  /* Title and status on the left, the Shorten switch on the right, then the link and Copy: about 110px tall */
  .client-link-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title toggle" "status toggle" "row row" "exit exit" "fb fb";
    gap: 2px 10px; padding: 6px 10px; align-items: center;
  }
  .guest-link-head { display: contents; }
  .guest-link-title { grid-area: title; }
  .guest-link-title { line-height: 1.2; font-size: 14px; }
  .guest-link-status { grid-area: status; justify-self: start; white-space: nowrap; line-height: 1.2; font-size: 12px; padding: 1px 8px; }
  .guest-link-toggle { gap: 6px; }
  .guest-link-toggle-text strong { font-size: 13px; }
  #exitClientLockBtn { grid-area: exit; justify-self: stretch; min-height: 44px; }
  .guest-link-row { grid-area: row; flex-wrap: nowrap; }
  .guest-link-toggle { grid-area: toggle; }
  .guest-link-toggle-text strong { white-space: nowrap; }
  .guest-link-toggle-text span { display: none; }
  .client-link-feedback { grid-area: fb; }
  .guest-link-field { flex: 1 1 0; }
  .client-link-btn { flex: 0 0 auto; min-width: 76px; padding: 6px 14px; }
  .client-link-retry { flex: 0 0 auto; }
}

/* Artwork tier banner: shorter, calmer */
.pricing-category-banner { gap: 6px; padding: 12px 14px; }
.pricing-category-header { gap: 6px 10px; }
.pricing-tier-badge { font-size: 13px; }
.pricing-rate-status { font-size: 13px; }
.pricing-disclaimer-box { font-size: 13px; line-height: 1.5; background: var(--bg-subtle); border: 1px solid var(--border-color); color: var(--text-main); }

/* ==========================================================================
   Softer light appearance: gentler surfaces and borders, same Ventura palette and text colours.
   Artwork, QR codes and the canvas are untouched (they are drawn on the canvas, not themed).
   ========================================================================== */
:root {
  --bg-app: #eceef4;
  --bg-surface: #f8f9fc;
  --bg-subtle: #f0f1f7;
  --bg-hover: #e5e8f1;
  --bg-stage: #dadee9;
  --border-color: #cfd3e0;
  --border-strong: #959bb4;
  --shadow-header: 0 3px 14px rgba(42, 45, 66, 0.06), 0 1px 2px rgba(42, 45, 66, 0.04);
  --shadow-card: 0 2px 10px rgba(42, 45, 66, 0.05), 0 1px 2px rgba(42, 45, 66, 0.03);
  --shadow-preview: 0 8px 26px rgba(42, 45, 66, 0.09);
}
html:not([data-theme="dark"]) :is(.workspace-grid, .sheet-bar, .client-link-bar) :is(input[type="text"], input[type="number"], textarea, select):not(.sr-only) {
  background-color: #fdfdfe;
}

/* Logo: slightly larger on wide, tall-enough screens; short laptops and phones keep the compact header */
@media (min-width: 1280px) and (min-height: 761px) {
  .brand-home-btn { padding: 6px 12px; min-height: 76px; }
  .wcu-logo-lockup { height: 68px; }
}

/* Tablet and desktop: title and status, the link with Copy, and the Shorten switch share one row */
@media (min-width: 601px) {
  .client-link-inner {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "head row toggle exit" "fb fb fb fb";
    align-items: center; gap: 6px 16px;
  }
  .guest-link-head { grid-area: head; flex-wrap: wrap; max-width: 240px; }
  #exitClientLockBtn { grid-area: exit; }
  .guest-link-row { grid-area: row; }
  .guest-link-toggle { grid-area: toggle; }
  .client-link-feedback { grid-area: fb; }
}

/* ==========================================================================
   Text hierarchy: one shared, theme-aware colour for descriptions, hints and supporting text.
   Softer than headings, labels and entered values (--text-main) but never faded: at least 4.5:1 on its backgrounds.
   Errors, warnings and success messages keep their own colours.
   ========================================================================== */
:root { --text-helper: #4b4f67; }
html[data-theme="dark"] { --text-helper: #c0c4d6; }
:root :is(
  .section-help, .section-meta, .family-note, .disclosure-hint, .template-catalog-note, .shortcuts-modal-subtitle,
  .pricing-tier-desc, .font-status-footnote, .canvas-drag-hint, .artwork-scope-note, .guest-link-toggle-text span,
  .field-hint:not(.is-warning, .is-error, .is-success, .pdf-review-message),
  .help-topic p, .help-topic li, .upload-text details.fold > span
),
html[data-theme] :is(
  .section-help, .section-meta, .family-note, .disclosure-hint, .template-catalog-note, .shortcuts-modal-subtitle,
  .pricing-tier-desc, .font-status-footnote, .canvas-drag-hint, .artwork-scope-note, .guest-link-toggle-text span,
  .field-hint:not(.is-warning, .is-error, .is-success, .pdf-review-message),
  .help-topic p, .help-topic li, .upload-text details.fold > span
) {
  color: var(--text-helper);
}

/* ==========================================================================
   SAVING: package choice, share-ready group, image preview
   ========================================================================== */
.export-package { border: 0; margin: 14px 0 0; padding: 0; min-width: 0; }
.export-package > legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--text-main); }
.export-package { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.export-package > legend { grid-column: 1 / -1; }
.choice-card {
  display: flex; align-items: flex-start; gap: 12px; min-height: 64px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-surface); color: var(--text-main);
}
.choice-card:hover { background: var(--bg-hover); }
.choice-card:has(input:checked) { border-color: var(--accent-primary); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-primary); }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.choice-card input { flex: 0 0 auto; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent-primary); }
.choice-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-card-text strong { font-size: 15px; color: var(--text-main); }
.choice-card-text span { font-size: 13px; line-height: 1.4; }
.share-ready { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--accent-border); border-radius: 12px; background: var(--accent-soft); }
.share-ready.hidden { display: none; }
.share-ready-title { margin: 0 0 4px; font-weight: 700; color: var(--text-main); }
.batch-progress #cancelBatchBtn { margin-top: 8px; min-height: 44px; }
.batch-progress #cancelBatchBtn.hidden { display: none; }
.export-btn-row .btn { min-height: 44px; }
.image-preview-card { max-width: 560px; }
.image-preview-body { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.image-preview-body img { width: 100%; max-height: 60vh; object-fit: contain; background: var(--bg-stage); border-radius: 8px; -webkit-touch-callout: default; }
@media (max-width: 600px) {
  .export-package { grid-template-columns: minmax(0, 1fr); }
  .export-btn-row { flex-direction: column; align-items: stretch; }
  .export-btn-row .btn { width: 100%; justify-content: center; }
}
html[data-theme="dark"] .choice-card:has(input:checked) { background: rgba(185, 126, 126, 0.16); border-color: #e8a6bb; box-shadow: inset 0 0 0 1px #e8a6bb; }

/* ==========================================================================
   Design journey: one heading, a soft grey label, three evenly aligned choices
   ========================================================================== */
.journey-selector-card .section-title-row { margin-bottom: 4px; }
.journey-selector-card h3 { margin: 0; }
.journey-sublabel { margin: 4px 0 0; font-size: 13px; color: var(--text-helper); }
.journey-selector-card { container-type: inline-size; container-name: journey; }
.journey-segmented-track { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
@container journey (min-width: 640px) {
  .journey-segmented-track { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
.journey-seg-btn { min-width: 0; min-height: 72px; padding: 14px 16px; border-radius: 12px; align-items: center; }
.journey-seg-btn .journey-btn-icon { width: 24px; height: 24px; }
.journey-btn-text { min-width: 0; gap: 3px; }
.journey-btn-text strong { font-size: 15px; line-height: 1.25; }
.journey-btn-text small { font-size: 13px; line-height: 1.3; color: var(--text-helper); }
.journey-seg-btn.active { border-color: var(--accent-primary); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-primary); }
.journey-seg-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
html[data-theme="dark"] .journey-seg-btn.active { background: rgba(185, 126, 126, 0.16); border-color: #e8a6bb; box-shadow: inset 0 0 0 1px #e8a6bb; }
.pricing-category-banner { margin-top: 16px; }
.pricing-disclaimer-box { background: transparent; border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px 12px; }
.pricing-disclaimer-box .info-icon { display: none; }
@media (max-width: 700px) {
  .journey-seg-btn { min-height: 64px; }
}

/* Missing / restoring artwork notice with a Re-upload button */
.artwork-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 0; }
.artwork-notice.hidden { display: none; }
.artwork-notice-text { flex: 1 1 260px; min-width: 0; line-height: 1.5; }
.artwork-notice .btn { min-height: 44px; }
.artwork-notice .btn.hidden { display: none; }
@media (max-width: 600px) { .artwork-notice .btn { width: 100%; justify-content: center; } }


/* Template gallery: thumbnails, groups, one tile per design */
.preset-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.preset-group-title {
  grid-column: 1 / -1; margin: 6px 0 -4px; font-size: 13px; font-weight: 700; color: var(--text-main);
}
.preset-grid .preset-group-title:first-child { margin-top: 0; }
.preset-card { padding: 0; overflow: hidden; gap: 0; min-height: 44px; }
.preset-thumb {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 5; background: var(--bg-stage, var(--bg-subtle)); overflow: hidden;
}
.preset-card .preset-thumb-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.preset-card .preset-thumb-placeholder {
  font-size: 12px; font-weight: 700; color: var(--text-helper, var(--text-secondary));
  border: 1px dashed var(--border-strong); border-radius: 8px; padding: 18px 12px; margin: 12px; text-align: center;
}
.preset-card .preset-selected-tag {
  position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-primary); color: #fff; font-size: 11.5px; font-weight: 700;
}
.preset-card-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.preset-card .preset-meta { font-size: 12.5px; line-height: 1.4; color: var(--text-helper, var(--text-secondary)); }
.preset-card:focus-visible { outline: 3px solid var(--accent-primary); outline-offset: 2px; }

.preset-card .preset-thumb-placeholder { margin: 0; }
.preset-card:has(.preset-thumb-placeholder) .preset-thumb { aspect-ratio: 16 / 9; }

/* Gallery on phones: two compact columns so several designs fit in the bottom sheet */
@media (max-width: 600px) {
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .preset-thumb { aspect-ratio: 1 / 1; }
  .preset-card .preset-thumb-placeholder { padding: 10px 6px; font-size: 11.5px; }
  .preset-card-body { padding: 8px 10px 10px; }
}

/* "Selected" sits at the bottom of the thumbnail, next to the name, so it is visible whenever the name is */
.preset-card .preset-selected-tag { top: auto; bottom: 8px; left: 8px; }
.preset-grid, .preset-group-title { scroll-margin-top: 8px; }

/* Selected badge shares the name's line, so it is always visible with the name */
.preset-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.preset-title-row strong { flex: 1; min-width: 0; }
.preset-card .preset-selected-tag {
  position: static; flex: none; width: 22px; height: 22px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1;
}
.preset-card .preset-selected-tag, .preset-card .preset-selected-tag > span { color: #fff; }


/* ==========================================================================
   Welcome dialog and planned-features note
   ========================================================================== */
/* Welcome: a small print-studio guide on warm paper (light) or matte charcoal (dark).
   Wedding Cards UG garnet is kept for the main action and the current step only. The overlay stays
   translucent so the chosen wallpaper and theme still show behind it. */
.welcome-backdrop {
  z-index: 10001;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(28, 24, 20, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
html[data-theme="dark"] .welcome-backdrop { background: rgba(8, 8, 8, 0.55); }
.welcome-card {
  --w-paper: #fbf8f2; --w-paper-2: #f2ede4; --w-rule: #e3dbce;
  --w-ink: #221f1b; --w-ink-2: #574f45; --w-ink-3: #6f675c;
  --w-garnet: #7a1f3d; --w-garnet-hover: #63182f; --w-mark: #7a1f3d; --w-on-garnet: #ffffff;
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--w-paper);
  color: var(--w-ink);
  border: 1px solid var(--w-rule);
  border-radius: 12px;
  padding: 24px 28px 16px;
  box-shadow: 0 18px 48px rgba(28, 24, 20, 0.22);
}
html[data-theme="dark"] .welcome-card {
  --w-paper: #1f1e1c; --w-paper-2: #2a2825; --w-rule: #3b3834;
  --w-ink: #f2ede4; --w-ink-2: #cdc5b9; --w-ink-3: #a59d91;
  --w-garnet: #8e2748; --w-garnet-hover: #a32f57; --w-mark: #e6a0b6; --w-on-garnet: #ffffff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}
.welcome-card > * { flex-shrink: 0; }
.welcome-logo { display: block; align-self: flex-start; width: auto; height: 28px; margin: 0 0 18px; }
html[data-theme="dark"] .welcome-logo { filter: brightness(0) invert(0.93); }
.welcome-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--w-ink);
  text-wrap: balance;
}
.welcome-lead { margin: 8px 0 0; max-width: 46ch; font-size: 14.5px; line-height: 1.45; color: var(--w-ink-2); text-wrap: pretty; }

/* Guide: one quiet card drawing plus the current step */
.welcome-guide {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 20px 0 0;
  padding: 16px 0 8px;
  border-top: 1px solid var(--w-rule);
}
.welcome-proof { margin: 0; color: var(--w-ink-3); }
.welcome-proof svg { display: block; width: 100%; height: auto; overflow: visible; }
.welcome-proof svg * { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.welcome-proof .wp-paper { fill: var(--w-paper-2); stroke: var(--w-ink-3); }
.welcome-proof .wp-out-sheet rect { fill: var(--w-paper-2); }
.welcome-proof .wp-out-sheet { opacity: 0.55; }
.welcome-proof .wp-name-line { stroke-width: 3; }
.welcome-proof .wp-out circle { fill: var(--w-paper); }
.welcome-proof .wp-out { opacity: 0.4; }
.welcome-proof[data-step="0"] .wp-art,
.welcome-proof[data-step="1"] .wp-name,
.welcome-proof[data-step="2"] .wp-out,
.welcome-proof[data-step="2"] .wp-out-sheet { color: var(--w-mark); opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .welcome-proof g { transition: color 0.2s ease, opacity 0.2s ease; } }

.welcome-stage { min-height: 92px; display: flex; flex-direction: column; justify-content: center; }
.welcome-slide[hidden] { display: none; }
.welcome-slide-img { display: none; }
.welcome-slide-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.welcome-step-label {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 2px;
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--w-ink-3);
}
.welcome-step-label .ui-icon { width: 16px; height: 16px; flex: none; color: var(--w-ink-2); }
.welcome-slide-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 19px; line-height: 1.2; color: var(--w-ink); }
.welcome-slide-text { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--w-ink-2); }
.welcome-badge { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--w-ink-2); }
.welcome-slide-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--w-ink); }
@media (prefers-reduced-motion: no-preference) { .welcome-slide:not([hidden]) { animation: welcome-in 0.2s ease; } }
@keyframes welcome-in { from { opacity: 0; } to { opacity: 1; } }

/* Step controls: small marks, full 44px targets */
.welcome-controls { display: flex; align-items: center; min-height: 44px; margin: 0 -10px 0 -12px; }
.welcome-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--w-ink-2); cursor: pointer;
}
.welcome-icon-btn[hidden], .welcome-dots[hidden] { display: none; }
.welcome-icon-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.welcome-icon-btn:hover { background: var(--w-paper-2); color: var(--w-ink); }
.welcome-pause { margin-left: auto; }
.welcome-pause .welcome-play-icon,
.welcome-pause[data-paused="true"] .welcome-pause-icon { display: none; }
.welcome-pause[data-paused="true"] .welcome-play-icon { display: block; }
.welcome-counter { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.welcome-dots { display: flex; align-items: center; }
.welcome-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
}
.welcome-dot-track { display: block; width: 14px; height: 3px; border-radius: 2px; overflow: hidden; background: var(--w-ink-3); opacity: 0.55; }
.welcome-dot:hover .welcome-dot-track { opacity: 1; }
.welcome-dot[aria-current="step"] .welcome-dot-track { width: 26px; opacity: 1; background: color-mix(in srgb, var(--w-mark) 35%, transparent); }
.welcome-dot-fill { display: none; height: 100%; width: 100%; background: var(--w-mark); transform-origin: left; transform: scaleX(1); }
.welcome-dot[aria-current="step"] .welcome-dot-fill { display: block; }
/* One pass per step while the guide advances; paused or reduced motion shows the current step filled */
@keyframes welcome-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Actions and the one local-preview note */
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 12px; }
.welcome-start {
  min-height: 44px; padding: 0 20px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--w-garnet); background: var(--w-garnet); color: var(--w-on-garnet);
  font-family: var(--font-ui); font-weight: 800; font-size: 15px;
}
.welcome-start:hover { background: var(--w-garnet-hover); border-color: var(--w-garnet-hover); }
.welcome-skip {
  min-height: 44px; padding: 0 2px; border: 0; background: transparent; cursor: pointer; color: var(--w-ink);
  font-family: var(--font-ui); font-weight: 800; font-size: 14px;
  text-decoration: underline; text-decoration-color: var(--w-ink-3); text-underline-offset: 4px;
}
.welcome-skip:hover { text-decoration-color: currentColor; }
.welcome-start:focus-visible, .welcome-skip:focus-visible, .welcome-icon-btn:focus-visible,
.welcome-dot:focus-visible, .welcome-slide-link:focus-visible { outline: 2px solid var(--w-ink); outline-offset: 2px; }
.welcome-local-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--w-rule); font-size: 12px; line-height: 1.4; color: var(--w-ink-3); }

@media (max-width: 480px), (max-height: 640px) {
  .welcome-backdrop { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .welcome-card { padding: 18px 18px 12px; max-height: calc(100dvh - 24px); }
  .welcome-logo { height: 24px; margin-bottom: 12px; }
  .welcome-title { font-size: 23px; }
  .welcome-lead { font-size: 13.5px; }
  .welcome-guide { grid-template-columns: 60px minmax(0, 1fr); gap: 14px; margin-top: 14px; padding: 12px 0 6px; }
  .welcome-stage { min-height: 86px; }
  .welcome-slide-title { font-size: 17px; }
  .welcome-slide-text { font-size: 13px; }
  .welcome-actions { margin-top: 8px; }
  .welcome-local-note { margin-top: 8px; padding-top: 8px; font-size: 11.5px; }
}

.planned-note {
  margin: 0 0 12px; padding: 10px 14px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--bg-subtle);
}
.planned-note strong { font-size: 13px; color: var(--text-main); }
.planned-note p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-helper, var(--text-secondary)); }

/* Compact appearance menu (Light / Dark / Auto) */
.theme-menu-wrap { position: relative; display: inline-flex; }
.theme-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border-radius: 999px; border: 1px solid var(--border-color);
  background: var(--bg-surface); color: var(--text-secondary); cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}
.theme-menu-btn:hover { color: var(--text-main); background: var(--bg-hover); }
.theme-menu-btn:focus-visible, .theme-menu-item:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.theme-menu-icon { display: inline-flex; }
.theme-menu-icon[hidden] { display: none; }
.theme-menu[hidden] { display: none; }
/* Expand inline into the original horizontal segmented pill. */
.theme-menu-btn[hidden] { display: none; }
.theme-menu {
  display: inline-flex; flex-wrap: nowrap; flex: 0 0 auto;
}
.theme-menu-item { flex: 1 0 auto; }
@media (max-width: 600px) {
  .header-mode-row .appearance-control { flex: 0 0 auto; width: auto; }
  .theme-menu-item { padding: 0 8px; }
}



/* Entry point to the local Digital Invitations preview (see docs/DIGITAL_INVITATIONS.md) */
.header-invitations-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--accent-border); background: var(--accent-soft); color: var(--accent-text);
  font-family: var(--font-ui); font-size: 13px; font-weight: 800; text-decoration: none;
}
.header-invitations-link:hover { background: var(--bg-hover); }
.header-invitations-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
@media (max-width: 600px) { .header-mode-row .header-invitations-link { width: 100%; } }

/* Guest workflow refinement: search, secondary tools and comfortable phone editing. */
.guest-quick-tools { gap: 8px; }
.guest-quick-tools .btn { display: inline-flex; gap: 8px; align-items: center; }
.guest-search-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 8px 0 6px; }
.guest-search-field { flex: 1 1 220px; min-width: 0; }
.guest-search-field > label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-main); }
.guest-search-control { position: relative; display: flex; align-items: center; gap: 8px; }
.guest-search-control > .ui-icon { position: absolute; left: 12px; color: #4b4f67; pointer-events: none; }
#guestSearchInput { width: 100%; min-height: 46px; padding-left: 38px; padding-right: 48px; font-size: 16px; }
#guestSearchInput::-webkit-search-cancel-button { display: none; }
#clearGuestSearchBtn { position: absolute; right: 2px; width: 44px; height: 44px; background: transparent; border: 0; color: #4b4f67; }
#clearGuestSearchBtn[hidden] { display: none; }
.guest-search-summary { margin: 8px 0 16px; font-size: 13px; line-height: 1.5; color: var(--text-helper); }
.guest-list-tools { flex: 0 0 auto; }
.guest-list-tools > summary { display: flex; gap: 8px; align-items: center; min-height: 46px; padding: 0 14px; border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; color: var(--text-main); background: var(--bg-subtle); font-size: 13px; list-style: none; }
.guest-list-tools > summary::-webkit-details-marker { display: none; }
.guest-list-tools[open] { flex-basis: 100%; }
.guest-list-tools[open] > summary { width: fit-content; border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent-text); }
.guest-list-tools > summary:hover { border-color: var(--border-strong); }
.guest-list-tools-body { padding: 12px 0; display: grid; gap: 12px; }
.guest-list-tools-body > .field-hint { margin: 0; }
.guest-list-tools-body .header-btn-group { justify-content: flex-start; padding-top: 12px; border-top: 1px solid var(--border-color); }
#panelClient .review-filter-bar { gap: 6px; }
#panelClient .filter-pill { padding-inline: 12px; }
.guest-empty-state { padding: 28px 16px !important; text-align: center; color: var(--text-main); }
.guest-empty-state p { color: var(--text-helper); line-height: 1.5; margin: 8px 0 16px; }
.guest-table input[aria-invalid="true"] { border: 2px solid var(--status-danger-text); }
.guest-table .row-preview-btn { gap: 6px; }
.guest-table .row-preview-btn[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent-border); background: var(--accent-soft); }
.guest-table .row-delete-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; }
.guest-table .row-status-dynamic { overflow-wrap: anywhere; }
#guestListTools summary:focus-visible, #guestSearchInput:focus-visible, #clearGuestSearchBtn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
#shortcutsModal .shortcuts-modal-footer { gap: 16px; flex-wrap: wrap; justify-content: space-between; }
#shortcutsModal .shortcuts-modal-card { max-height: min(90dvh, 760px); }
#shortcutsModal .shortcuts-modal-body { min-height: 0; }
#shortcutsModal .shortcuts-modal-header, #shortcutsModal .shortcuts-modal-footer { flex-shrink: 0; }
#shortcutsModal .shortcuts-modal-footer .checkbox-label { min-height: 44px; }

@media (max-width: 600px) {
  #panelClient .panel-header { margin-bottom: 8px; gap: 8px; }
  #panelClient .guest-quick-tools { display: flex; width: 100%; gap: 8px; }
  #panelClient .guest-quick-tools .btn { flex: 1 1 0; min-width: 0; justify-content: center; min-height: 44px; padding: 6px; }
  #panelClient .card-section { padding: 14px 12px; }
  #panelClient .section-title-row { gap: 8px; margin-bottom: 12px; }
  #panelClient h3 { font-size: 18px; line-height: 1.3; }
  #panelClient .section-help { font-size: 13px; line-height: 1.5; }
  #panelClient .upload-zone { padding: 12px; }
  #panelClient .upload-zone-body { gap: 8px; }
  #panelClient .upload-text strong { font-size: 14px; line-height: 1.4; }
  #panelClient .upload-actions { gap: 8px; }
  #panelClient .single-guest-form { gap: 12px; }
  #panelClient input:not([type="checkbox"]), #panelClient textarea, #panelClient select { font-size: 16px; scroll-margin-block: 72px; }
  #panelClient .single-guest-form .fg-grow { flex-basis: 100%; }
  #panelClient .single-guest-form .fg-btn .btn { width: 100%; justify-content: center; min-height: 46px; }
  .guest-search-tools { gap: 8px; }
  .guest-search-field { flex-basis: 100%; }
  .guest-list-tools { width: 100%; }
  .guest-list-tools > summary { width: fit-content; }
  #panelClient .guest-list-tools-body .bulk-fix-actions { grid-template-columns: 1fr; }
  #panelClient .guest-list-tools-body .header-btn-group { margin: 0; }
  #panelClient .guest-list-tools-body .header-btn-group .btn { flex: 1 1 120px; }
  .guest-table tr { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .guest-table td.col-row { grid-column: 2; }
  .guest-table td.col-status .row-status-dynamic { grid-column: 1 / -1; grid-row: 3; justify-self: stretch; text-align: left; }
  .guest-table .row-status-badges { justify-content: flex-start; }
  .guest-table .issue-detail-text { text-align: left; line-height: 1.45; }
  .guest-table td.col-adm { grid-column: 1 / -1; grid-row: 4; }
  .guest-table td.col-adm .row-adm-input { width: 80px; }
  .guest-table td.col-actions { grid-column: 1 / -1; grid-row: 5; justify-self: stretch; }
  .guest-table .row-actions-group { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .guest-table .row-preview-btn { flex: 1 1 auto; }
  .guest-table td.col-status .row-notes-input { grid-row: 6; min-width: 0; width: 100%; }
  .guest-table tr:has(.guest-empty-state) { display: block; }
  .guest-table td.guest-empty-state { display: block; width: 100% !important; }
  .guest-search-summary { margin-bottom: 10px; }
  #shortcutsModal { padding: 8px; }
  #shortcutsModal .shortcuts-modal-card { max-height: calc(100dvh - 16px); }
  #shortcutsModal .shortcuts-modal-header, #shortcutsModal .shortcuts-modal-footer { padding: 12px; }
  #shortcutsModal .shortcuts-modal-body { padding: 12px; }
  #shortcutsModal .shortcuts-table td { padding: 8px 4px; }
  #shortcutsModal .shortcuts-table td:first-child { width: 32%; white-space: normal; }
  #shortcutsModal .shortcuts-modal-footer { gap: 4px; }
  #shortcutsModal .shortcuts-modal-footer .checkbox-label { flex: 1 1 190px; font-size: 13px; }
  html.keyboard-visible .client-view-switch { position: static; }
  html.keyboard-visible .workspace-grid[data-step="staff"] .tool-rail { bottom: calc(100% - var(--visual-top) - var(--visual-height)); }
  html.keyboard-visible .workspace-grid[data-step="staff"][data-sheet="open"] .studio-sections { top: calc(var(--visual-top) + 4px); bottom: auto; height: max(100px, calc(var(--visual-height) - var(--rail-h) - 4px)); }
  html.keyboard-visible .studio-sections input, html.keyboard-visible .studio-sections textarea { font-size: 16px; scroll-margin-top: 56px; }
}
@media (max-width: 600px) and (max-height: 450px) {
  .client-view-switch { position: static; }
  .workspace-grid { --sheet-h: calc(100dvh - var(--rail-h) - 8px); }
}

@media (max-width: 600px) {
  /* An unavailable link needs a status, not inactive URL and shortening controls. */
  #simClientBanner[data-link-state="unavailable"] .guest-link-field,
  #simClientBanner[data-link-state="unavailable"] .guest-link-toggle { display: none; }
  #simClientBanner[data-link-state="unavailable"] .client-link-inner { display: flex; flex-wrap: wrap; gap: 6px 10px; min-height: 44px; }
  #simClientBanner[data-link-state="unavailable"] .guest-link-head { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
  #simClientBanner[data-link-state="unavailable"] .client-link-feedback { flex-basis: 100%; }
}

.guest-list-tools:not([open]) > .guest-list-tools-body { display: none; }
.guest-table .row-notes-input { min-height: 44px; }

/* Give guest editing the wider desktop column; retain the sticky card alongside it. */
@media (min-width: 1081px) {
  .workspace-grid[data-step="client"] { grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr); }
  .workspace-grid[data-step="client"] .guest-table { min-width: 680px; }
  .workspace-grid[data-step="client"] .guest-table .col-name { min-width: 170px; }
}
.guest-table .row-status-badges { overflow-wrap: normal; }
.guest-table .status-chip { white-space: nowrap; }
@media (max-width: 600px) {
  #panelClient details.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  #panelClient details.fold > summary::after { flex-shrink: 0; margin-left: auto; }
}
/* Opaque selected buttons avoid stacked row tints reducing dark-theme contrast. */
html[data-theme="dark"] .guest-table .row-preview-btn[aria-pressed="true"] { background: var(--bg-surface); }

.guest-link-info-icon { display: none; }
@media (max-width: 600px) {
  #simClientBanner[data-link-state="unavailable"] .guest-link-row { flex: 0 0 auto; }
  #simClientBanner[data-link-state="unavailable"] #copyGuestLinkBtn { min-width: 44px; width: 44px; min-height: 44px; padding: 8px; align-items: center; }
  #simClientBanner[data-link-state="unavailable"] .guest-link-copy-label { display: none; }
  #simClientBanner[data-link-state="unavailable"] .guest-link-info-icon { display: block; }
}

.review-stat-invalid { color: var(--status-danger-text); }
.review-stat-duplicate { color: var(--status-warn-text); }
.review-stat-long { color: var(--status-info-text); }

/* Optional print imposition: protected review with a complete-card, paper-white preview. */
.print-sheets-dialog { color: var(--text-main); background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; padding: 0; width: min(1040px, calc(100vw - 32px)); max-width: none; max-height: calc(var(--visual-height, 100dvh) - 24px); inset: calc(var(--visual-top, 0px) + 12px) 0 auto; margin: 0 auto; overflow: hidden; }
.print-sheets-dialog[open] { display: flex; flex-direction: column; }
.print-sheets-dialog::backdrop { background: rgb(15 18 34 / 58%); }
.print-sheets-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.print-sheets-header h2 { font-size: 22px; line-height: 1.25; margin: 0 0 6px; }
.print-sheets-header p { margin: 0; color: var(--text-helper); font-size: 14px; }
.print-sheets-header .btn-icon { width: 44px; height: 44px; flex-shrink: 0; }
.print-sheets-body { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 28px; padding: 24px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.print-sheets-settings, .print-sheets-review { min-width: 0; }
.print-sheets-settings { display: flex; flex-direction: column; gap: 16px; }
.print-sheets-dialog .control-group { margin: 0; min-width: 0; }
.print-setting-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.print-setting-wide { grid-column: 1 / -1; margin: 0; }
.print-sheets-dialog input, .print-sheets-dialog select { min-width: 0; width: 100%; min-height: 44px; }
.print-sheets-dialog .btn { min-height: 44px; }
.print-sheets-dialog .field-hint { color: var(--text-helper); line-height: 1.5; font-size: 13px; }
.print-spacing { border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.print-spacing summary { cursor: pointer; min-height: 44px; padding: 12px 0; font-size: 14px; }
.print-spacing[open] .print-setting-pair { padding-bottom: 14px; }
.print-spacing:not([open]) > div { display: none; }
.print-sheet-count { margin: 0 0 14px; font-size: 18px; line-height: 1.4; }
.print-sheet-preview { margin: 0; }
.print-sheet-preview canvas { display: block; width: 100%; height: auto; background: white; box-shadow: 0 6px 18px rgb(15 18 34 / 15%); }
.print-sheet-preview figcaption { font-size: 12px; text-align: center; color: var(--text-helper); padding: 12px 0; font-variant-numeric: tabular-nums; }
.print-sheet-nav { display: flex; gap: 12px; align-items: center; justify-content: center; }
.print-sheet-nav .btn { width: 44px; padding: 0; }
.print-sheet-nav span { min-width: 110px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.print-sheet-contents { list-style: none; padding: 0; margin: 16px 0; font-size: 13px; color: var(--text-main); }
.print-sheet-contents li { margin: 8px 0; overflow-wrap: anywhere; }
.print-sheet-error { border: 1px solid currentColor; border-radius: 8px; padding: 12px; font-size: 14px; color: var(--status-danger-text); }
.print-sheets-footer { flex-shrink: 0; padding: 14px 24px; border-top: 1px solid var(--border-color); }
.print-sheets-footer #printSheetsProgress:empty { display: none; }
.print-sheets-footer #printSheetsProgress { margin: 0 0 10px; overflow-wrap: anywhere; }
.print-sheets-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.print-sheets-dialog :focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
@media (max-width: 700px) {
  .print-sheets-dialog { width: calc(100vw - 16px); border-radius: 12px; inset: calc(var(--visual-top, 0px) + 8px) 0 auto; max-height: calc(var(--visual-height, 100dvh) - 16px); }
  .print-sheets-header { padding: 12px 16px; }
  .print-sheets-header h2 { font-size: 20px; }
  .print-sheets-header p { font-size: 13px; }
  .print-sheets-body { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 24px; }
  .print-sheets-dialog input, .print-sheets-dialog select { font-size: 16px; }
  .print-sheets-review { order: -1; }
  .print-sheets-footer { padding: 10px 12px; }
  .print-sheets-actions { flex-wrap: nowrap; gap: 8px; }
  .print-sheets-actions .btn { padding: 10px 12px; font-size: 13px; }
  .print-sheets-actions .btn-primary { flex: 1; }
  html.keyboard-visible .print-sheets-header p { display: none; }
  html.keyboard-visible .print-sheets-header { padding: 8px 12px; align-items: center; }
  html.keyboard-visible .print-sheets-header h2 { margin: 0; font-size: 18px; }
}

.print-sheets-actions:has(#printReexportBtn:not(.hidden)) { flex-wrap: wrap; }
.print-sheets-footer #printAlreadyExported { margin: 0 0 8px; }

/* Save & share: finite groups, explicit scope and local delivery history. */
.export-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.export-heading-actions .btn { min-height: 44px; }
.export-detail-notes summary, .delivery-dialog summary { cursor: pointer; min-height: 44px; padding: 12px 0; font-size: 14px; }
.export-detail-notes:not([open]) > p, .delivery-dialog details:not([open]) > :not(summary) { display: none; }
.delivery-dialog { color: var(--text-main); background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; padding: 0; width: min(720px, calc(100vw - 24px)); max-width: none; max-height: calc(var(--visual-height, 100dvh) - 24px); inset: calc(var(--visual-top, 0px) + 12px) 0 auto; margin: 0 auto; overflow: hidden; }
.delivery-dialog[open] { display: flex; flex-direction: column; }
.delivery-dialog::backdrop { background: rgb(15 18 34 / 58%); }
.delivery-header { padding: 18px 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-shrink: 0; border-bottom: 1px solid var(--border-color); }
.delivery-header h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; }
.delivery-header p { margin: 0; font-size: 14px; color: var(--text-helper); line-height: 1.5; }
.delivery-header .btn-icon { width: 44px; height: 44px; flex-shrink: 0; }
.delivery-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 22px; }
.delivery-destinations { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.delivery-destinations .btn { flex-direction: column; gap: 6px; min-height: 68px; padding: 10px 4px; font-size: 13px; }
.delivery-destinations svg { width: 22px; height: 22px; }
.delivery-destinations [aria-pressed="true"] { color: var(--on-accent); background: var(--accent-primary); border-color: var(--accent-primary); }
.delivery-setting-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.delivery-dialog .control-group { min-width: 0; margin: 0; }
.delivery-dialog input, .delivery-dialog select { min-width: 0; width: 100%; min-height: 44px; }
.delivery-dialog .btn, .delivery-dialog a.btn { min-height: 44px; }
.delivery-dialog .field-hint { color: var(--text-helper); font-size: 13px; line-height: 1.5; }
.delivery-dialog progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 4px; overflow: hidden; background: var(--bg-hover); accent-color: var(--accent-primary); margin: 8px 0 16px; }
.delivery-dialog progress::-webkit-progress-bar { background: var(--bg-hover); }
.delivery-dialog progress::-webkit-progress-value { background: var(--accent-primary); }
.delivery-error { color: var(--status-danger-text); border: 1px solid currentColor; border-radius: 8px; padding: 12px; font-size: 14px; }
.delivery-prepared { border-top: 1px solid var(--border-color); padding-top: 18px; margin: 12px 0 20px; }
.delivery-prepared h3 { font-size: 18px; margin: 0; }
.delivery-tool-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.delivery-tool-row .btn { font-size: 13px; }
.delivery-image-preview { margin: 16px 0; }
.delivery-image-preview img { display: block; max-width: 100%; max-height: 400px; width: auto; height: auto; margin: auto; object-fit: contain; }
.delivery-image-preview figcaption { margin: 10px 0; font-size: 14px; text-align: center; overflow-wrap: anywhere; }
.delivery-failures ul { padding-left: 20px; color: var(--status-danger-text); font-size: 13px; overflow-wrap: anywhere; }
.delivery-help { border-top: 1px solid var(--border-color); margin-top: 16px; }
.delivery-footer { padding: 12px 22px; border-top: 1px solid var(--border-color); flex-shrink: 0; }
.delivery-footer #deliveryMessage { max-height: 4.5em; overflow-y: auto; margin: 0 0 8px; overflow-wrap: anywhere; }
.delivery-footer #deliveryMessage:empty { display: none; }
.delivery-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.delivery-actions .btn { font-size: 13px; padding: 10px 14px; }
.delivery-dialog :focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.print-sheets-footer #printSheetsProgress { max-height: 3em; overflow-y: auto; }
@media (max-width: 700px) {
  .delivery-dialog, .print-sheets-dialog { width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); inset: calc(var(--visual-top, 0px) + max(8px, env(safe-area-inset-top, 0px))) 0 auto; max-height: calc(var(--visual-height, 100dvh) - max(8px, env(safe-area-inset-top, 0px)) - max(8px, env(safe-area-inset-bottom, 0px))); border-radius: 12px; }
  .delivery-header { padding: 12px; }
  .delivery-header h2 { font-size: 20px; }
  .delivery-header p { font-size: 13px; }
  .delivery-body { padding: 14px 12px; }
  .delivery-destinations { gap: 5px; }
  .delivery-destinations .btn { font-size: 11px; }
  .delivery-dialog input, .delivery-dialog select { font-size: 16px; }
  .delivery-footer { padding: 10px 12px; }
  .delivery-actions .btn-primary { flex: 1 1 150px; }
  .delivery-actions .btn { padding: 10px 12px; }
  .export-heading-actions { width: 100%; }
  html.keyboard-visible .delivery-header { padding: 8px 12px; align-items: center; }
  html.keyboard-visible .delivery-header h2 { margin: 0; font-size: 18px; }
  html.keyboard-visible .delivery-header p { display: none; }
}
@media (display-mode: standalone) {
  .app-shell { padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
  .tool-rail { padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
}

.planned-note summary { cursor: pointer; min-height: 44px; display: list-item; padding: 10px 0; }
.planned-note:not([open]) p { display: none; }

#projectStorageNotice { grid-column: 1 / -1; margin: 0; }
