#policyViewerModal :is(.policy-viewer-body, .policy-doc-card, .policy-doc-meta-item, .policy-signature-form, .policy-viewer-signature, .policy-table-wrap) {
  background: var(--policy-surface);
  border-color: var(--policy-line);
  color: var(--policy-ink);
  box-shadow: none;
}
#policyViewerModal :is(.policy-revision, .policy-notice, .policy-doc-switcher a, .policy-table tr:first-child td) {
  background: var(--policy-muted);
  border-color: var(--policy-line);
  color: var(--policy-ink);
}
#policyViewerModal :is(.policy-doc-card p, .policy-doc-card li, .policy-list-item, .policy-doc-meta-label, .policy-viewer-kicker) {
  color: var(--policy-secondary);
}
#policyViewerModal :is(.policy-doc-card strong, .policy-doc-card h2, .policy-doc-meta-value, .policy-table td) {
  color: var(--policy-ink);
  border-color: var(--policy-line);
}
#policyViewerModal :is(.policy-doc-card, .policy-doc-meta-value) a { color: var(--policy-link); }
#policyViewerStatus:empty { display: none; }

.ui-v2 .ui-title {
  margin-bottom: 18px;
  font-size: var(--type-page,clamp(34px, 5vw, 58px));
  font-weight: 650;
  line-height: 1.02;
}

@media (max-width: 720px) {

  .ui-v2 .ui-title {
    font-size: var(--type-page,clamp(32px, 10vw, 46px));
  }
}

html[data-auth-target="home"]:not(.auth-known-signed-in) body.auth-loading {
  height: auto;
  overflow: visible;
}

html[data-auth-target="home"]:not(.auth-known-signed-in) body.auth-loading #authGate {
  position: relative;
  height: auto;
  overflow: visible;
}




@media (max-width: 700px) {
  body.product-feature-page .feature-page-hero,
  body.product-feature-page .feature-proof-strip,
  body.product-feature-page .feature-page-section,
  body.product-feature-page .feature-page-cta {
    width: min(calc(100% - 24px), var(--ui-content));
  }

  body.product-feature-page .feature-flow-row p {
    grid-column: 2;
  }
}

body.plan-page .plan-feature-list li::before {
  position: absolute;
  width: 26px;
  height: 26px;
  top: 22px;
  left: 22px;
  content: "✓";
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--plan-accent-soft);
  color: var(--plan-accent);
  font-size: 12px;
  font-weight: 820;
  box-shadow: none;
}

@media (max-width: 760px) {
  body.policy-page-public .policy-doc-switcher {
    justify-content: flex-start;
    overflow-x: auto;
  }

  body.policy-page-public .policy-doc-switcher a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}


#bootOverlay {
  background:
    radial-gradient(circle at 12% 4%, rgba(52, 132, 255, 0.16), transparent 29rem),
    radial-gradient(circle at 88% 90%, rgba(41, 205, 169, 0.12), transparent 30rem),
    var(--loading-bg);
}

#bootOverlay .boot-msg {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--loading-ink);
  font-family: var(--ui-font-display, "Space Grotesk", sans-serif);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-transform: none;
}

#bootOverlay .boot-msg::before {
  width: 38px;
  height: 38px;
  content: "TR";
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #45a7ff 0%, #087af6 55%, #655bff 100%);
  box-shadow: 0 7px 18px rgba(8, 122, 246, 0.25), inset 0 1px rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}


/* Authenticated workspace shell ----------------------------------------- */

body.auth-ready[data-app-shell]:not(#_) {
  background: var(--ui-grey-50);
}

body.auth-ready[data-app-shell]:not(#_)::before {
  display: none;
}

#appShell.ui-workspace {
  min-height: 100vh;
  color: var(--ui-ink);
}

#appShell.ui-workspace .app-topnav {
  width: calc(100% + (var(--ui-gutter) * 2));
  max-width: none;
  margin: 0 calc(var(--ui-gutter) * -1) 10px;
  padding: 12px var(--ui-gutter);
  position: sticky;
  top: 0;
  z-index: 100;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  border-radius: 0;
  background: color-mix(in srgb, var(--ui-canvas-raised) 82%, transparent);
  box-shadow: none;
  color: var(--ui-ink);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

#appShell.ui-workspace .app-topnav-trigger {
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--ui-ink-secondary);
  font-size: var(--type-body);
  font-weight: 620;
  letter-spacing: -0.01em;
}

#appShell.ui-workspace .app-topnav-menu,
#appShell.ui-workspace .app-topnav-status-menu {
  margin-top: 7px;
  padding: 7px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ui-surface-solid) 94%, transparent);
  box-shadow: var(--ui-shadow-md);
  color: var(--ui-ink);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
}

#appShell.ui-workspace .app-topnav-item:focus-within > .app-topnav-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#appShell.ui-workspace .app-topnav-menu button {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--ui-ink-secondary);
  font-size: var(--type-body);
  font-weight: 560;
}

#appShell.ui-workspace .app-topnav-menu hr {
  border-top-color: var(--ui-line);
}

#appShell.ui-workspace .app-theme-toggle {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--ui-line);
  border-radius: 11px;
  background: var(--ui-surface-solid);
  color: var(--ui-ink-secondary);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

#appShell.ui-workspace .app-theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#appShell.ui-workspace .app-topnav-status-pill {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--ui-line);
  border-radius: 11px;
  background: var(--ui-surface-solid);
  color: var(--ui-ink-secondary);
  font-size: var(--type-caption);
}

#appShell.ui-workspace .app-topnav-status-pill strong {
  color: var(--ui-ink);
}

#appShell.ui-workspace .app-topnav-status-menu {
  min-width: 285px;
}

#appShell.ui-workspace .app-topnav-status-message,
#appShell.ui-workspace .app-topnav-status-list li,
#appShell.ui-workspace .top-status-value {
  color: var(--ui-ink);
}

#appShell.ui-workspace .app-topnav-status-list li {
  background: var(--ui-surface-muted);
}

#appShell.ui-workspace .app-topnav-status-list li span,
#appShell.ui-workspace .app-topnav-status-updated {
  color: var(--ui-ink-tertiary);
}

#appShell.ui-workspace .app-topnav-signout {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--ui-line);
  border-radius: 11px;
  background: var(--ui-surface-solid);
  color: var(--ui-red);
  font-size: var(--type-caption);
  font-weight: 650;
}

#appShell.ui-workspace .pane-transition {
  color: var(--ui-ink);
}

#appShell.ui-workspace .pane-transition.pane-animate {
  animation: none;
}

#appShell.ui-workspace .card,
#appShell.ui-workspace .dashboard-card,
#appShell.ui-workspace .contracts-card,
#appShell.ui-workspace .po-recon-card,
#appShell.ui-workspace .connections-hub {
  overflow: clip;
  margin: 0 0 18px;
  padding: clamp(18px, 2.2vw, 28px);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface-solid);
  box-shadow: var(--ui-shadow-sm);
  color: var(--ui-ink);
  transform: none;
}

#appShell.ui-workspace .card::before {
  display: none;
}

#appShell.ui-workspace :where(h1, h2, h3, h4, h5) {
  color: var(--ui-ink);
  font-family: var(--ui-font-sans);
  letter-spacing: -0.03em;
}

#appShell.ui-workspace :where(.muted, small, .control-sub) {
  color: var(--ui-ink-secondary);
}

#appShell.ui-workspace :where(input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="url"], input[type="date"], select, textarea) {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--ui-line-strong);
  border-top-width: 1px;
  border-radius: 12px;
  background: var(--ui-surface-solid);
  color: var(--ui-ink);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
}

#appShell.ui-workspace :where(input, select, textarea):focus {
  border-color: var(--ui-blue);
  outline: none;
  box-shadow: var(--ui-focus);
}

/* UI #48: fields reached by keyboard get the same solid ring as buttons. */
#appShell.ui-workspace :where(input, select, textarea):focus-visible {
  outline: 2px solid var(--ui-blue);
  outline-offset: 2px;
  box-shadow: none;
}

#appShell.ui-workspace input[type="file"] {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-muted);
  color: var(--ui-ink-secondary);
}

#appShell.ui-workspace :where(input[type="checkbox"], input[type="radio"]) {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--ui-blue);
}

#appShell.ui-workspace :where(input, select, textarea):disabled {
  opacity: 0.66;
  cursor: not-allowed;
}

#appShell.ui-workspace label {
  color: var(--ui-ink-secondary);
  font-size: var(--type-caption);
  font-weight: 650;
}

#appShell.ui-workspace :where(.stats, .dashboard-missing-metrics, .contracts-summary-metrics) {
  gap: 10px;
}

#appShell.ui-workspace :where(.stat, .dashboard-metric, .contracts-summary-item) {
  min-width: 140px;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface-muted);
  box-shadow: none;
  color: var(--ui-ink);
  transform: none;
}

#appShell.ui-workspace :where(.stat, .dashboard-metric, .contracts-summary-item):hover {
  border-color: var(--ui-line-strong);
  box-shadow: none;
  transform: none;
}

#appShell.ui-workspace .stat::after {
  display: none;
}

#appShell.ui-workspace :where(.stat .label, .dashboard-metric-label, .contracts-summary-item .label) {
  color: var(--ui-ink-secondary);
  font-size: var(--type-caption);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#appShell.ui-workspace :where(.stat .value, .dashboard-metric-value, .contracts-summary-item .value) {
  color: var(--ui-ink);
  font-family: var(--ui-font-display);
  font-weight: 650;
  letter-spacing: -0.035em;
  text-shadow: none;
}

#appShell.ui-workspace :where(.table-wrap, .dashboard-metrics-table, #previewScroll) {
  overflow: auto;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface-solid);
}

#appShell.ui-workspace table {
  color: var(--ui-ink);
}

#appShell.ui-workspace th,
#appShell.ui-workspace td {
  padding: 11px 12px;
  border-bottom-color: var(--ui-line);
  color: var(--ui-ink);
}

#appShell.ui-workspace tbody tr:hover td {
  background: var(--ui-blue-soft);
  filter: none;
}

#appShell.ui-workspace .hero-min-title {
  color: var(--ui-ink);
  font-family: var(--ui-font-display);
  letter-spacing: -0.03em;
}

#appShell.ui-workspace .app-support-footer {
  margin-top: 10px;
  padding: 18px;
  border: 0;
  border-top: 1px solid var(--ui-line);
  border-radius: 0;
  background: transparent;
  color: var(--ui-ink-tertiary);
}

#appShell.ui-workspace .app-support-footer a {
  color: var(--ui-blue);
}

body.auth-ready[data-app-shell]:not(#_) .app-update-banner, body.auth-ready #appShell.ui-workspace .app-update-banner {
  box-sizing: border-box;
  width: min(560px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 14px;
  font-family: var(--workspace-font-sans, system-ui, sans-serif);
  border-color: rgba(29, 29, 31, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  color: var(--ui-grey-900);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

body.auth-ready[data-app-shell]:not(#_) .app-update-banner-title, body.auth-ready #appShell.ui-workspace .app-update-banner-title {
  color: var(--ui-grey-900);
  font-size: var(--type-body,14px);
  font-weight: 650;
}

body.auth-ready[data-app-shell]:not(#_) .app-update-banner-actions, body.auth-ready #appShell.ui-workspace .app-update-banner-actions { flex-shrink:0; gap:8px; }
body.auth-ready[data-app-shell]:not(#_) .app-update-banner-actions button, body.auth-ready #appShell.ui-workspace .app-update-banner-actions button { appearance:none; margin:0; padding:10px 14px; min-height:40px; border:1px solid var(--ui-grey-200); border-radius:9px; background:#fff; color:var(--ui-grey-600); box-shadow:none; font:600 var(--type-body,12px)/1.4 system-ui,sans-serif; white-space:nowrap; cursor:pointer; }
body.auth-ready[data-app-shell]:not(#_) #appUpdateBannerRefresh, body.auth-ready #appShell.ui-workspace #appUpdateBannerRefresh { background:#1769e8; border-color:#1769e8; color:#fff; }
body.auth-ready[data-app-shell]:not(#_) .app-update-banner-actions button:hover, body.auth-ready #appShell.ui-workspace .app-update-banner-actions button:hover { filter:brightness(.96); }
body.auth-ready[data-app-shell]:not(#_) .app-update-banner-actions button:focus-visible, body.auth-ready #appShell.ui-workspace .app-update-banner-actions button:focus-visible { outline:2px solid var(--ui-blue); outline-offset:3px; }
body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) #appUpdateBannerDismiss, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] #appUpdateBannerDismiss { background:var(--ui-grey-200); color:var(--ui-grey-800); border-color:var(--ui-grey-300); }

body.auth-ready[data-app-shell]:not(#_) .app-update-banner-text, body.auth-ready #appShell.ui-workspace .app-update-banner-text {
  color: var(--ui-grey-600);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .app-update-banner, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .app-update-banner {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--ui-raised);
  color: var(--ui-grey-900);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .app-update-banner-title, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .app-update-banner-title {
  color: var(--ui-grey-900);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .app-update-banner-text, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .app-update-banner-text {
  color: var(--ui-grey-600);
}

body.auth-ready[data-app-shell]:not(#_) .modal, body.auth-ready #appShell.ui-workspace .modal {
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: rgb(15 23 42 / 40%);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Dark: the backdrop dims the page (the light-mode tint would lighten a near-black canvas). */
body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal {
  background: var(--ui-backdrop);
}

/* Every modal dialog's backdrop (written with the colour, since older browsers don't pass variables to ::backdrop). */
html body[data-app-shell][data-app-theme="dark"]:not(#_):not(#_):not(#_) dialog:not(.app-dialog-layer)::backdrop {
  background: rgb(3 5 10 / 66%);
}

/* Dark: native controls and scrollbars draw dark everywhere, including dialogs outside #appShell. */
html:has(> body[data-app-shell][data-app-theme="dark"]), body[data-app-shell][data-app-theme="dark"] {
  color-scheme: dark;
}

/* Dark: an input's or an outlined button's edge reaches 3:1. Their border rules read the line tokens, so the tokens are re-pointed
   on the control itself: transparent borders, fills and blue primary buttons don't change. Rows and cards that are buttons keep soft lines. */
body[data-app-shell][data-app-theme="dark"]:not(#_) :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"]), select, textarea, button, .btn):not(.row, .cs-provider-row, .workflow-picker-card, .sync-saved-strip, [role="tab"]) {
  --ui-line: var(--ui-control-border);
  --ui-line-strong: var(--ui-control-border);
  --line: var(--ui-control-border);
  --line2: var(--ui-control-border);
  --input-border: var(--ui-control-border);
  --dismiss-line: var(--ui-control-border);
  --workspace-chip-border: var(--ui-control-border);
}

body.auth-ready[data-app-shell]:not(#_) .modal :where(.panel, .modal-content), body.auth-ready #appShell.ui-workspace .modal :where(.panel, .modal-content) {
  padding: 22px;
  border: 1px solid rgba(29, 29, 31, 0.14);
  border-radius: var(--workspace-window-radius,14px);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 40px 100px rgba(0, 0, 0, 0.16);
  color: var(--ui-grey-900);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
}

body.auth-ready[data-app-shell]:not(#_) .modal :where(.panel, .modal-content) header, body.auth-ready #appShell.ui-workspace .modal :where(.panel, .modal-content) header {
  border-bottom-color: rgba(29, 29, 31, 0.1);
  background: transparent;
}

body.auth-ready[data-app-shell]:not(#_) .modal :where(h2, h3, h4), body.auth-ready #appShell.ui-workspace .modal :where(h2, h3, h4) {
  color: var(--ui-grey-900);
  font-family: var(--workspace-font-sans, sans-serif);
}

body.auth-ready[data-app-shell]:not(#_) .modal :where(.muted, p, label), body.auth-ready #appShell.ui-workspace .modal :where(.muted, p, label) {
  color: var(--ui-grey-600);
}

body.auth-ready[data-app-shell]:not(#_) .modal :where(input, select, textarea), body.auth-ready #appShell.ui-workspace .modal :where(input, select, textarea) {
  border: 1px solid rgba(29, 29, 31, 0.16);
  background: #ffffff;
  box-shadow: none;
  color: var(--ui-grey-900);
  color-scheme: light;
}

body.auth-ready[data-app-shell]:not(#_) .modal :where(input, textarea)::placeholder, body.auth-ready #appShell.ui-workspace .modal :where(input, textarea)::placeholder {
  color: var(--ui-grey-500);
}

body.auth-ready[data-app-shell]:not(#_) .modal :where(input, select, textarea):focus, body.auth-ready #appShell.ui-workspace .modal :where(input, select, textarea):focus {
  border-color: #087af6;
  box-shadow: 0 0 0 3px rgba(8, 122, 246, 0.14);
  outline: none;
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal :where(.panel, .modal-content), body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal :where(.panel, .modal-content) {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--ui-raised);
  color: var(--ui-grey-900);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal :where(.panel, .modal-content) header, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal :where(.panel, .modal-content) header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal :where(h2, h3, h4), body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal :where(h2, h3, h4) {
  color: var(--ui-grey-900);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal :where(.muted, p, label), body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal :where(.muted, p, label) {
  color: var(--ui-grey-600);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal :where(input, select, textarea), body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal :where(input, select, textarea) {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--ui-grey-100);
  color: var(--ui-grey-900);
  color-scheme: dark;
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal :where(input, textarea)::placeholder, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal :where(input, textarea)::placeholder {
  color: var(--ui-grey-500);
}

body.auth-ready[data-app-shell]:not(#_) .modal :where(.panel, .modal-content) > header, body.auth-ready #appShell.ui-workspace .modal :where(.panel, .modal-content) > header,
body.auth-ready[data-app-shell]:not(#_) .modal .modal-header, body.auth-ready #appShell.ui-workspace .modal .modal-header {
  margin-bottom: 18px;
  padding: 0 0 14px;
  align-items: flex-start;
}

body.auth-ready[data-app-shell]:not(#_) .modal :where(.panel, .modal-content) > header h3, body.auth-ready #appShell.ui-workspace .modal :where(.panel, .modal-content) > header h3,
body.auth-ready[data-app-shell]:not(#_) .modal .modal-header h3, body.auth-ready #appShell.ui-workspace .modal .modal-header h3 {
  margin: 0;
  font-size: var(--type-section,20px);
  font-weight: 720;
  letter-spacing: -0.035em;
}

body.auth-ready[data-app-shell]:not(#_) .modal :where(.modal-form, .u-modal-stack-sm, .u-modal-stack-md), body.auth-ready #appShell.ui-workspace .modal :where(.modal-form, .u-modal-stack-sm, .u-modal-stack-md) {
  gap: 13px;
}

body.auth-ready[data-app-shell]:not(#_) .modal .modal-actions, body.auth-ready #appShell.ui-workspace .modal .modal-actions,
body.auth-ready[data-app-shell]:not(#_) .modal .u-modal-actions-end, body.auth-ready #appShell.ui-workspace .modal .u-modal-actions-end,
body.auth-ready[data-app-shell]:not(#_) .modal .connections-editor-actions, body.auth-ready #appShell.ui-workspace .modal .connections-editor-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(29, 29, 31, 0.1);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal .modal-actions, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal .modal-actions,
body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal .u-modal-actions-end, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal .u-modal-actions-end,
body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal .connections-editor-actions, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal .connections-editor-actions {
  border-top-color: rgba(255, 255, 255, 0.1);
}

body.auth-ready[data-app-shell]:not(#_) .modal .modal-message, body.auth-ready #appShell.ui-workspace .modal .modal-message {
  padding: 10px 12px;
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 11px;
  background: var(--ui-grey-50);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal .modal-message, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal .modal-message {
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--ui-grey-100);
}

body.auth-ready[data-app-shell]:not(#_) .connections-editor-panel, body.auth-ready #appShell.ui-workspace .connections-editor-panel {
  width: min(620px, calc(100vw - 32px));
}

body.auth-ready[data-app-shell]:not(#_) .connections-editor-form, body.auth-ready #appShell.ui-workspace .connections-editor-form {
  gap: 14px;
  margin-top: 0;
}

body.auth-ready[data-app-shell]:not(#_) .connections-editor-field > span, body.auth-ready #appShell.ui-workspace .connections-editor-field > span {
  color: var(--ui-grey-600);
  font-size: var(--type-caption,12px);
  font-weight: 700;
}

body.auth-ready[data-app-shell]:not(#_) .connections-editor-field :where(input, select), body.auth-ready #appShell.ui-workspace .connections-editor-field :where(input, select) {
  width: 100%;
  max-width: none;
  min-height: 42px;
  border-radius: 11px;
}

body.auth-ready[data-app-shell]:not(#_) .connections-editor-help, body.auth-ready #appShell.ui-workspace .connections-editor-help {
  padding: 12px 14px;
  border: 1px solid rgba(8, 122, 246, 0.14);
  border-radius: 12px;
  background: rgba(8, 122, 246, 0.07);
  color: var(--ui-grey-600);
  line-height: 1.5;
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .connections-editor-field > span, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .connections-editor-field > span {
  color: var(--ui-grey-600);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .connections-editor-help, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .connections-editor-help {
  border-color: rgba(64, 156, 255, 0.18);
  background: rgba(64, 156, 255, 0.1);
  color: var(--ui-grey-600);
}

body.auth-ready[data-app-shell]:not(#_) .connections-editor-message:empty, body.auth-ready #appShell.ui-workspace .connections-editor-message:empty {
  display: none;
}

body.auth-ready[data-app-shell]:not(#_) .connections-editor-message:not(:empty), body.auth-ready #appShell.ui-workspace .connections-editor-message:not(:empty) {
  padding: 10px 12px;
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 11px;
  background: var(--ui-grey-50);
}

body.auth-ready[data-app-shell]:not(#_) .connections-editor-message.is-success, body.auth-ready #appShell.ui-workspace .connections-editor-message.is-success {
  border-color: rgba(22, 163, 116, 0.18);
  background: rgba(22, 163, 116, 0.08);
}

body.auth-ready[data-app-shell]:not(#_) .connections-editor-message.is-error, body.auth-ready #appShell.ui-workspace .connections-editor-message.is-error {
  border-color: rgba(221, 59, 76, 0.18);
  background: rgba(221, 59, 76, 0.08);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .connections-editor-message:not(:empty), body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .connections-editor-message:not(:empty) {
  border-color: rgba(255, 255, 255, 0.1);
  background: var(--ui-grey-100);
}

body.auth-ready[data-app-shell]:not(#_) .connections-editor-actions, body.auth-ready #appShell.ui-workspace .connections-editor-actions {
  margin-top: 4px;
}

body.auth-ready[data-app-shell]:not(#_) #busy, body.auth-ready #appShell.ui-workspace #busy {
  /* Preserve the existing interaction lock during file analysis; presentation
     moves to the centered operation pill rather than the old modal spinner. */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor:progress;
}

body.auth-ready[data-app-shell]:not(#_) #busy .box, body.auth-ready #appShell.ui-workspace #busy .box {
  display:none;
  padding: 18px 20px;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.18);
  color: var(--ui-grey-900);
}

body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) #busy .box, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] #busy .box {
  border-color: rgba(255, 255, 255, 0.13);
  background: var(--ui-raised);
  color: var(--ui-grey-900);
}

#appShell.ui-workspace :where(.u-empty-state-cell, .u-empty-state-cell-sm, .dashboard-empty) {
  min-height: 90px;
  padding-block: 28px;
  color: var(--ui-ink-tertiary);
  font-size: var(--type-caption);
  text-align: center;
}

#appShell.ui-workspace :where(.dashboard-progress, .loading-progress) {
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--ui-surface-muted);
}

/* One progress card for long jobs: title and time left, the bar, one detail line, then what to do and the actions. */
#appShell.ui-workspace .job-progress {display:flex;flex-direction:column;gap:0;padding:12px 14px;border:1px solid var(--ui-line);border-left:3px solid var(--ui-blue);border-radius:12px;background:var(--ui-surface-solid);color:var(--ui-ink);font-size:var(--type-body)}
#appShell.ui-workspace .job-progress[data-tone="ok"] {border-left-color:var(--ui-green)}
#appShell.ui-workspace .job-progress[data-tone="warn"] {border-left-color:var(--ui-amber)}
#appShell.ui-workspace .job-progress__top {display:flex;justify-content:space-between;align-items:baseline;gap:4px 14px;flex-wrap:wrap}
#appShell.ui-workspace .job-progress__top strong {font-size:var(--type-body);font-weight:650;color:var(--ui-ink)}
#appShell.ui-workspace .job-progress .dashboard-progress__left {font-size:var(--type-caption);color:var(--ui-ink-secondary);font-variant-numeric:tabular-nums;white-space:nowrap}
#appShell.ui-workspace .job-progress :is(.dashboard-progress__track, .job-progress__moving) {height:8px;margin:9px 0 7px;border-radius:999px;background:var(--ui-line);overflow:hidden}
#appShell.ui-workspace .job-progress .dashboard-progress__value {display:block;width:100%}
#appShell.ui-workspace .job-progress__moving i {display:block;width:30%;height:100%;border-radius:999px;background:var(--ui-blue);animation:job-progress-move 1.6s ease-in-out infinite}
@keyframes job-progress-move {0% {transform:translateX(-100%)} 100% {transform:translateX(340%)}}
@media (prefers-reduced-motion: reduce) {#appShell.ui-workspace .job-progress__moving i {animation:none;width:100%;opacity:.35}}
#appShell.ui-workspace .job-progress .dashboard-progress__detail {font-size:var(--type-caption);color:var(--ui-ink-secondary);font-variant-numeric:tabular-nums;line-height:1.5}
#appShell.ui-workspace .job-progress .dashboard-progress__foot {display:flex;justify-content:space-between;align-items:center;gap:8px 14px;flex-wrap:wrap;margin-top:8px;padding-top:8px;border-top:1px solid var(--ui-line)}
#appShell.ui-workspace .job-progress .dashboard-progress__foot p {margin:0;flex:1 1 260px;font-size:var(--type-body);line-height:1.5;color:var(--ui-ink-secondary)}
#appShell.ui-workspace .job-progress__acts {display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}

@media (max-width: 720px) {

  #appShell.ui-workspace .app-topnav {
    margin-bottom: 2px;
    padding-block: 10px;
  }

  #appShell.ui-workspace .app-topnav-status-pill > span:not(.app-topnav-status-dot),
  #appShell.ui-workspace .app-topnav-status-pill > strong {
    display: none;
  }

  #appShell.ui-workspace .app-topnav-status-pill {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  #appShell.ui-workspace .app-topnav-status-menu {
    position: fixed;
    top: 62px;
    right: 14px;
    left: 14px;
    min-width: 0;
  }

  #appShell.ui-workspace .app-topnav-signout {
    width: 38px;
    padding: 0;
    overflow: hidden;
    color: transparent;
  }

  #appShell.ui-workspace .app-topnav-signout::before {
    content: "\2192";
    color: var(--ui-red);
    font-size: var(--type-section);
    transform: rotate(180deg);
  }

  #appShell.ui-workspace .card,
#appShell.ui-workspace .dashboard-card,
#appShell.ui-workspace .contracts-card,
#appShell.ui-workspace .po-recon-card,
#appShell.ui-workspace .connections-hub {
    margin-bottom: 14px;
    padding: 17px;
    border-radius: 17px;
  }

  body.auth-ready[data-app-shell]:not(#_) .modal, body.auth-ready #appShell.ui-workspace .modal {
    padding: 10px;
  }

  body.auth-ready[data-app-shell]:not(#_) .modal :where(.panel, .modal-content), body.auth-ready #appShell.ui-workspace .modal :where(.panel, .modal-content) {
    padding: 18px;
    border-radius: 18px;
  }
}

/* Demo-aligned application frame ---------------------------------------- */

#appShell.ui-workspace {
  background:
    radial-gradient(circle at 14% 3%, rgba(73, 121, 255, 0.16), transparent 31rem),
    radial-gradient(circle at 90% 88%, rgba(32, 195, 167, 0.1), transparent 30rem),
    var(--ui-canvas);
  color-scheme: light;
}

#appShell.ui-workspace[data-ui-theme="dark"] {
  background:
    radial-gradient(circle at 14% 3%, rgba(32, 105, 255, 0.2), transparent 31rem),
    radial-gradient(circle at 90% 88%, rgba(32, 195, 167, 0.07), transparent 30rem),
    var(--ui-canvas);
  color-scheme: dark;
}

#appShell.ui-workspace .workspace-stage {
  min-height: 100vh;
  padding: clamp(12px, 2.2vw, 30px);
}

#appShell.ui-workspace .workspace-window {
  /* Let data-heavy workspace views use modern desktop widths while keeping
     the surrounding stage gutter and a readable cap on ultrawide displays. */
  width: min(1920px, 100%);
  min-height: min(950px, calc(100vh - 32px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  overflow: clip;
  border: 1px solid var(--ui-line-strong);
  border-radius: 26px;
  background:
    linear-gradient(
      90deg,
      var(--ui-sidebar-surface) 0,
      var(--ui-sidebar-surface) 248px,
      var(--ui-workspace-surface) 248px,
      var(--ui-workspace-surface) 100%
    );
  box-shadow: var(--ui-shadow-lg);
  isolation: isolate;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#appShell.ui-workspace .workspace-sidebar {
  min-width: 0;
  height: min(950px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  min-height: 0;
  padding: 18px 14px 14px;
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ui-line);
  background: var(--ui-sidebar-surface);
  isolation: isolate;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#appShell.ui-workspace .workspace-brand {
  width: 100%;
  min-height: 48px;
  padding: 5px 9px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease;
}

#appShell.ui-workspace .workspace-brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--ui-band-fill);
  box-shadow: none;
  color: var(--ui-band-strong);
}

#appShell.ui-workspace .workspace-brand-mark svg {
  width: 23px;
  height: 23px;
}

#appShell.ui-workspace .workspace-brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

#appShell.ui-workspace .workspace-brand-name {
  color: var(--ui-ink);
  font-family: var(--ui-font-sans);
  font-size: var(--type-emphasis);
  font-weight: 710;
  letter-spacing: -0.02em;
}

#appShell.ui-workspace .workspace-brand-version {
  color: var(--ui-ink-tertiary);
  font-size: var(--type-caption);
  font-weight: 600;
}

#appShell.ui-workspace .workspace-nav-scroll {
  min-height: 0;
  flex: 1;
  padding: 2px 2px 18px 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-line-strong) transparent;
}

#appShell.ui-workspace .workspace-nav-scroll::-webkit-scrollbar {
  width: 6px;
}

#appShell.ui-workspace .workspace-nav-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--ui-line-strong);
}

#appShell.ui-workspace .workspace-nav-group {
  position: static;
}

/* Before access answers on a refresh, the menu the last signed-in account had (app-sidebar-hint.js sets data-nav-shown;
   app-access-policy.js removes it once access answers or the account differs), so the sidebar does not change. */
#appShell[data-nav-shown]:not([data-nav-shown~="btnDashboard"]) #btnDashboard,
#appShell[data-nav-shown]:not([data-nav-shown~="btnSupport"]) #btnSupport,
#appShell[data-nav-shown]:not([data-nav-shown~="btnRecon"]) #btnRecon,
#appShell[data-nav-shown]:not([data-nav-shown~="btnQboRecon"]) #btnQboRecon,
#appShell[data-nav-shown]:not([data-nav-shown~="btnPosRecon"]) #btnPosRecon,
#appShell[data-nav-shown]:not([data-nav-shown~="btnSyncHub"]) #btnSyncHub,
#appShell[data-nav-shown]:not([data-nav-shown~="btnConnections"]) #btnConnections,
#appShell[data-nav-shown]:not([data-nav-shown~="btnSearch"]) #btnSearch,
#appShell[data-nav-shown]:not([data-nav-shown~="btnSecurity"]) #btnSecurity,
#appShell[data-nav-shown]:not([data-nav-shown~="btnHowTo"]) #btnHowTo,
#appShell[data-nav-shown]:not([data-nav-shown~="btnTemplates"]) #btnTemplates,
#appShell[data-nav-shown]:not([data-nav-shown~="btnMpDownloads"]) #btnMpDownloads,
#appShell[data-nav-shown]:not([data-nav-shown~="btnContracts"]) #btnContracts,
#appShell[data-nav-shown]:not([data-nav-shown~="btnSeasonSeats"]) #btnSeasonSeats,
#appShell[data-nav-shown]:not([data-nav-shown~="btnCanceledEvents"]) #btnCanceledEvents,
#appShell[data-nav-shown]:not([data-nav-shown~="btnPoBeta"]) #btnPoBeta,
#appShell[data-nav-shown]:not([data-nav-shown~="btnMpTags"]) #btnMpTags,
#appShell[data-nav-shown]:not([data-nav-shown~="btnMarketplaceCancellations"]) #btnMarketplaceCancellations,
#appShell[data-nav-shown]:not([data-nav-shown~="btnTerms"]) #btnTerms,
#appShell[data-nav-shown]:not([data-nav-shown~="btnMissing"]) #btnMissing,
#appShell[data-nav-shown]:not([data-nav-shown~="btnCreditCards"]) #btnCreditCards,
#appShell[data-nav-shown]:not([data-nav-shown~="group-workspace"]) [data-nav-group="workspace"],
#appShell[data-nav-shown]:not([data-nav-shown~="group-utilities"]) [data-nav-group="utilities"],
#appShell[data-nav-shown]:not([data-nav-shown~="group-tracking"]) [data-nav-group="tracking"] {
  display: none !important;
}
/* Refresh: a returning account with POS Alerts sees it from the first frame (app-sidebar-hint.js sets data-nav-boot;
   app-access-policy.js removes it once it decides). Without it the Tracking items below jump. */
#appShell[data-nav-boot~="btnPoBeta"] #btnPoBeta[hidden] {
  display: flex !important; /* beats the shared [hidden] rule, which uses !important */
}

/* !important in the next 4 rules that use it: it beats the base styles and the page header rules and others. */
#appShell.ui-workspace .app-topnav-menu.workspace-nav-menu .workspace-nav-item > span:last-child,
#appShell.ui-workspace .app-topnav-menu.workspace-nav-menu :where(#btnMissing, #btnCreditCards) > span:last-child {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-family: var(--ui-font-sans);
  font-size: var(--type-caption) !important;
  font-weight: 570;
  line-height: 1.25;
  letter-spacing: 0 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appShell.ui-workspace .app-topnav-menu.workspace-nav-menu .workspace-nav-item:hover {
  background: color-mix(in srgb, var(--ui-surface-solid) 48%, transparent);
  color: var(--ui-ink);
}

#appShell.ui-workspace[data-ui-theme="dark"] .app-topnav-menu.workspace-nav-menu .workspace-nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
}

#appShell.ui-workspace .workspace-nav-cluster {
  min-width: 0;
  display: grid;
}

#appShell.ui-workspace .workspace-nav-cluster-toggle-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#appShell.ui-workspace .workspace-nav-subnav {
  min-width: 0;
  margin: 3px 0 5px 20px;
  padding-left: 8px;
  display: grid;
  gap: 1px;
  border-left: 1px solid var(--ui-line-strong);
}

#appShell.ui-workspace .workspace-nav-subnav[hidden] {
  display: none !important;
}

#appShell.ui-workspace .workspace-nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--ui-ink-tertiary);
}

#appShell.ui-workspace .workspace-nav-icon::before {
  display: none;
}

#appShell.ui-workspace .workspace-nav-icon svg {
  width: 17px;
  height: 17px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#appShell.ui-workspace .workspace-nav-item.is-active .workspace-nav-icon svg {
  stroke-width: 1.9;
}

#appShell.ui-workspace .workspace-sidebar-footer {
  display: none;
}

#appShell.ui-workspace .workspace-sidebar-footer strong,
#appShell.ui-workspace .workspace-sidebar-footer span {
  display: block;
}

#appShell.ui-workspace .workspace-sidebar-footer strong {
  color: var(--ui-ink);
  font-size: var(--type-caption);
}

#appShell.ui-workspace .workspace-sidebar-footer span {
  color: var(--ui-ink-secondary);
  font-size: var(--type-caption);
}

#appShell.ui-workspace .workspace-window {
  /* Resize once. Animating grid tracks repeatedly lays out every visible
     table and squeezes navigation whose labels have already disappeared. */
  transition: none;
}

#appShell.ui-workspace .workspace-sidebar {
  transition: none;
}

@media (prefers-reduced-motion: no-preference) {
  #appShell.ui-workspace:not(.is-sidebar-collapsed) .workspace-sidebar :is(
    .workspace-brand-copy,
    .workspace-nav-item > span:last-child,
    .workspace-profile-copy,
    .workspace-profile-plan
  ) {
    animation: workspace-sidebar-label-reveal 100ms ease-out;
  }
}

#appShell.ui-workspace.is-sidebar-collapsed .workspace-sidebar {
  padding-inline: 9px;
}

#appShell.ui-workspace.is-sidebar-collapsed .workspace-brand {
  justify-content: center;
  padding-inline: 0;
}

#appShell.ui-workspace.is-sidebar-collapsed :is(
  .workspace-brand-copy,
  .workspace-nav-label,
  .workspace-nav-item > span:last-child,
  .workspace-sidebar-footer
) {
  display: none;
}

#appShell.ui-workspace.is-sidebar-collapsed .workspace-nav-group + .workspace-nav-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ui-line);
}

#appShell.ui-workspace.is-sidebar-collapsed .app-topnav-menu.workspace-nav-menu .workspace-nav-item {
  padding: 0;
  justify-content: center;
}

#appShell.ui-workspace.is-sidebar-collapsed .workspace-nav-subnav {
  display: none !important;
}

#appShell.ui-workspace.is-sidebar-collapsed .workspace-nav-icon {
  width: 22px;
  height: 22px;
}

#appShell.ui-workspace > .workspace-nav-flyout {
  width: min(228px, calc(100vw - 24px));
  max-height: min(360px, calc(100vh - 24px));
  padding: 8px;
  position: fixed;
  z-index: 5000;
  display: grid;
  gap: 4px;
  overflow: auto;
  border: 1px solid var(--ui-line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ui-surface-solid) 96%, transparent);
  box-shadow: var(--ui-shadow-md);
  color: var(--ui-ink);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

#appShell.ui-workspace > .workspace-nav-flyout[hidden] {
  display: none !important;
}

#appShell.ui-workspace .workspace-nav-flyout-title {
  padding: 7px 9px 5px;
  color: var(--ui-ink-tertiary);
  font-size: var(--type-caption);
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#appShell.ui-workspace .workspace-nav-flyout-item {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ui-ink-secondary);
  font: 600 var(--type-caption)/1.2 var(--ui-font-sans);
  text-align: left;
  cursor: pointer;
}

#appShell.ui-workspace .workspace-nav-flyout-item .workspace-nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

#appShell.ui-workspace .workspace-nav-flyout-item .workspace-nav-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  #appShell.ui-workspace .workspace-window,
  #appShell.ui-workspace .workspace-sidebar {
    transition: none;
  }
}

#appShell.ui-workspace .workspace-toolbar-title {
  color: var(--ui-ink);
  font-family: var(--ui-font-display);
  font-size: var(--type-emphasis);
  font-weight: 680;
  letter-spacing: -0.015em;
}

#appShell.ui-workspace .workspace-toolbar-actions {
  justify-self: auto;
}

/* Keep the live health data available to the dashboard while simplifying the toolbar. */

#appShell.ui-workspace .workspace-content {
  width: 100%;
  min-width: 0;
  padding: 28px 30px 34px;
  flex: 1;
}

#appShell.ui-workspace .workspace-content > * {
  width: 100%;
  max-width: var(--workspace-page-max);
  margin-inline: auto;
}

#appShell.ui-workspace .workspace-content > .card {
  margin-bottom: 18px;
}

#appShell.ui-workspace .workspace-window .app-support-footer {
  width: auto;
  margin: 0 30px 18px;
}

@media (max-width: 1060px) {
  #appShell.ui-workspace .workspace-window {
    grid-template-columns: 220px minmax(0, 1fr);
    background:
      linear-gradient(
        90deg,
        var(--ui-sidebar-surface) 0,
        var(--ui-sidebar-surface) 220px,
        var(--ui-workspace-surface) 220px,
        var(--ui-workspace-surface) 100%
      );
  }
}

@media (max-width: 760px) {
  #appShell.ui-workspace .workspace-stage {
    padding: 0;
  }

  #appShell.ui-workspace:not(.is-phone-nav) .workspace-window {
    min-height: 100vh;
    grid-template-columns: 74px minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    background:
      linear-gradient(
        90deg,
        var(--ui-sidebar-surface) 0,
        var(--ui-sidebar-surface) 74px,
        var(--ui-workspace-surface) 74px,
        var(--ui-workspace-surface) 100%
      );
  }

  #appShell.ui-workspace .workspace-sidebar {
    height: 100vh;
    min-height: 0;
    top: 0;
    padding-inline: 9px;
  }

  #appShell.ui-workspace:not(.is-phone-nav) .workspace-brand {
    justify-content: center;
    padding-inline: 0;
  }

  #appShell.ui-workspace:not(.is-phone-nav) .workspace-brand-copy,
  #appShell.ui-workspace:not(.is-phone-nav) .workspace-nav-label,
  #appShell.ui-workspace:not(.is-phone-nav) .workspace-nav-item > span:last-child,
  #appShell.ui-workspace:not(.is-phone-nav) .workspace-sidebar-footer {
    display: none;
  }

  #appShell.ui-workspace:not(.is-phone-nav) .workspace-nav-group + .workspace-nav-group {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ui-line);
  }

  #appShell.ui-workspace:not(.is-phone-nav) .app-topnav-menu.workspace-nav-menu .workspace-nav-item {
    padding: 0;
    justify-content: center;
  }

  #appShell.ui-workspace:not(.is-phone-nav) .workspace-nav-icon {
    width: 22px;
    height: 22px;
  }

  #appShell.ui-workspace .workspace-toolbar-title {
    display: none;
  }

  #appShell.ui-workspace .workspace-toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  #appShell.ui-workspace .workspace-content {
    padding: 22px 14px 26px;
  }

  #appShell.ui-workspace .workspace-window .app-support-footer {
    margin-inline: 14px;
  }
}

/* Demo-aligned reconciliation pages ------------------------------------- */

#appShell.ui-workspace .workspace-page-head {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

#appShell.ui-workspace .workspace-page-eyebrow {
  margin-bottom: 6px;
  color: var(--ui-blue);
  font-size: var(--type-caption);
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

#appShell.ui-workspace .workspace-page-head h1 {
  margin: 0;
  color: var(--ui-ink);
  font-family: var(--ui-font-display);
  font-size: var(--type-page);
  font-weight: 730;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

#appShell.ui-workspace .workspace-page-copy {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--ui-ink-secondary);
  font-size: var(--type-body);
}

#appShell.ui-workspace .workspace-page-badge {
  min-height: 32px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: var(--ui-surface);
  color: var(--ui-ink-secondary);
  font-size: var(--type-caption);
  font-weight: 680;
  white-space: nowrap;
}

#appShell.ui-workspace .workspace-page > .card,
#appShell.ui-workspace .workspace-page > .dashboard-grid > .card,
#appShell.ui-workspace .workspace-page > [class*="-grid"] > .card {
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

#appShell.ui-workspace .workspace-page > .card {
  margin-bottom: 14px;
}

#appShell.ui-workspace .workspace-page .dashboard-heading,
#appShell.ui-workspace .workspace-page .u-section-title,
#appShell.ui-workspace .workspace-page :where(.card, details) > h2,
#appShell.ui-workspace .workspace-page :where(.card, details) > h3 {
  color: var(--ui-ink);
  font-family: var(--ui-font-sans);
  font-weight: 690;
  letter-spacing: -0.022em;
}

#appShell.ui-workspace .workspace-page :where(.u-section-header, .dashboard-spotlight-header, .marketplace-downloads-header, .terms-card-header, .contracts-summary) {
  gap: 18px;
}

#appShell.ui-workspace .workspace-page :where(.pane-meta, .dashboard-metric, .stat, .connections-provider-meta, .dashboard-missing-webhook-banner) {
  border-color: var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface-muted);
}

#appShell.ui-workspace .workspace-page :where(.contracts-table, .dashboard-metrics, .terms-table) {
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ui-ink);
}

#appShell.ui-workspace .workspace-page :where(.contracts-table, .dashboard-metrics, .terms-table) thead th {

  color: var(--ui-ink-tertiary);
  font-size: var(--type-caption);
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

#appShell.ui-workspace .workspace-page :where(.contracts-table, .dashboard-metrics, .terms-table) tbody tr:hover td {
  background: var(--ui-blue-soft);
}

#appShell.ui-workspace .workspace-page :where(.source-toggle, .source-seg, .dashboard-missing-webhook-tablist) {
  border-color: var(--ui-line);
  background: var(--ui-surface-muted);
}

#appShell.ui-workspace .workspace-page details {
  border-color: var(--ui-line);
  border-radius: 16px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

/* Diagnostic disclosures are flat rows within a browser card. */
#appShell.ui-workspace .workspace-page .browser-diagnostic-profile details {
  border: 0;
  border-top: 1px solid var(--ui-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#appShell.ui-workspace .workspace-page .pane-qbo-header-main {
  min-width: 0;
  flex: 1;
}

#appShell.ui-workspace .workspace-page .pane-qbo-header-main > .muted {
  max-width: 760px;
  font-size: var(--type-caption);
  line-height: 1.55;
}

#appShell.ui-workspace .workspace-page .pane-qbo-header-controls {
  min-width: min(100%, 270px);
  align-items: flex-end;
}

#appShell.ui-workspace .workspace-page .brand-status,
#appShell.ui-workspace .workspace-page .loading-pill {
  border-color: var(--ui-line-strong);
  border-radius: 999px;
  background: var(--ui-surface-muted);
  box-shadow: none;
  color: var(--ui-ink-secondary);
}

#appShell.ui-workspace .workspace-page .pane-meta-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ui-surface-solid) 62%, transparent);
}

#appShell.ui-workspace .workspace-page .pane-meta-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ui-ink-tertiary);
  font-size: var(--type-caption);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}



#appShell.ui-workspace .workspace-page .pane-meta-value {
  display: block;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  margin-top: 3px;
  color: var(--ui-ink);
  font-size: var(--type-caption);
  font-weight: 680;
  line-height: 1.35;
}

#appShell.ui-workspace .integration-page-toolbar {
  min-width: 290px;
  padding: 10px 11px;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 9px;
  border: 1px solid var(--ui-line);
  border-radius: 15px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

#appShell.ui-workspace .integration-page-toolbar.is-actions-only {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#appShell.ui-workspace .integration-page-toolbar.is-status-only {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#appShell.ui-workspace .integration-page-status,
#appShell.ui-workspace .integration-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

#appShell.ui-workspace .integration-page-status {
  width: 100%;
}

#appShell.ui-workspace .integration-page-actions :where(button, .btn, .btn-outline, .chip-btn) {
  min-height: 34px;
  margin: 0;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: var(--type-body);
}

#appShell.ui-workspace .workspace-page-primary-status {
  min-height: 29px;
  margin: 0;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: var(--type-caption);
  font-weight: 690;
}

#appShell.ui-workspace .integration-page-updated {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ui-ink-tertiary);
  font-size: var(--type-caption);
  white-space: nowrap;
}

#appShell.ui-workspace .integration-page-updated > strong,
#appShell.ui-workspace .integration-page-updated > .pane-meta-value {
  margin: 0;
  color: var(--ui-ink-secondary);
  font-size: var(--type-caption);
  font-weight: 650;
}

/* !important in the rule below: it beats the base styles and the page header rules and others. */
#appShell.ui-workspace .workspace-plumbing-controls {
  display: none !important;
}

#appShell.ui-workspace #paneImportHub :where(.stepper, .column-map-fields),
#appShell.ui-workspace :where(#paneImport, #paneInvoice) :where(#importMatchRuleRow, #invoiceMatchRuleRow, #importSourceColumnsRow, #invoiceSourceColumnsRow) {
  padding: 11px 12px;
  border: 1px solid var(--ui-line);
  border-radius: 13px;
  background: var(--ui-surface-muted);
}

#appShell.ui-workspace .workspace-mode-switch .workspace-mode-option {
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ui-ink-secondary);
  font: 680 var(--type-body)/1 var(--ui-font-sans);
  letter-spacing: -0.015em;
  cursor: pointer;
  transition: background-color 90ms ease, border-color 90ms ease, color 90ms ease, box-shadow 90ms ease;
}

#appShell.ui-workspace .workspace-mode-switch .workspace-mode-option:hover:not(:disabled) {
  color: var(--ui-ink);
}

#appShell.ui-workspace .workspace-mode-switch .workspace-mode-option[aria-selected="true"] {
  border-color: var(--ui-line);
  background: var(--ui-surface-solid);
  color: var(--ui-ink);
  box-shadow: 0 2px 7px color-mix(in srgb, var(--ui-ink) 11%, transparent);
}

#appShell.ui-workspace .workspace-mode-switch .workspace-mode-option:focus-visible {
  outline: 2px solid var(--ui-blue);
  outline-offset: 2px;
}

#appShell.ui-workspace .workspace-mode-switch .workspace-mode-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#appShell.ui-workspace .recon-center-switch .workspace-mode-option {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: var(--type-body);
}

#appShell.ui-workspace .recon-center-next-steps {
  margin: 0 0 14px;
  flex-wrap: wrap;
}

#appShell.ui-workspace .recon-center-next-steps > div {
  min-width: 0;
}

@media (max-width: 600px) {
  #appShell.ui-workspace .recon-center-next-steps > div,
  #appShell.ui-workspace .recon-center-next-steps button {
    width: 100%;
  }
}

#appShell.ui-workspace .workspace-api-usage {
  flex-shrink: 0;
  max-height: 38vh;
  overflow: auto;
  margin-top: 12px;
  padding: 8px 0;
  font-size: var(--type-caption);
  color: var(--ui-ink-secondary);
  border-bottom: 1px solid var(--ui-line);
}
#appShell.ui-workspace .workspace-api-usage summary { cursor: pointer; }
#appShell.ui-workspace .workspace-api-usage p { max-width: 90ch; }



@media (max-width: 520px) {

  #appShell.ui-workspace .workspace-mode-switch .workspace-mode-option {
    min-height: 40px;
    padding-inline: 10px;
  }

}

@media (max-width: 980px) {

  #appShell.ui-workspace .workspace-page .pane-qbo-header-controls {
    width: 100%;
    align-items: flex-start;
  }
}


body.ui-public-page .home-top--capsule .home-header-demo {
  border-radius: 24px;
}







/* Page-specific workspace blueprints ----------------------------------- */

#appShell.ui-workspace .workspace-page-aside {
  min-width: max-content;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex-direction: column;
  gap: 9px;
}

#appShell.ui-workspace .workspace-page-actions,
#appShell.ui-workspace .workspace-page-statuses {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

#appShell.ui-workspace .workspace-page-live-status {
  width: auto;
  max-width: 360px;
  min-height: 28px;
  margin: 0;
  padding: 6px 9px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: var(--ui-surface);
  color: var(--ui-ink-secondary);
  font-size: var(--type-caption);
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appShell.ui-workspace .workspace-summary-grid {
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#appShell.ui-workspace .workspace-summary-grid > :where(div, article) {
  min-width: 0;
  min-height: 94px;
  padding: 15px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  border: 1px solid var(--ui-line);
  border-radius: 17px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

#appShell.ui-workspace .workspace-summary-grid :where(
  .label,
  .dashboard-metric-label,
  .security-summary-label,
  span
) {
  color: var(--ui-ink-tertiary);
  font-size: var(--type-caption);
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

#appShell.ui-workspace .workspace-summary-grid :where(
  .value,
  .dashboard-metric-value,
  .security-summary-value,
  strong
) {
  max-width: 100%;
  margin-top: 7px;
  overflow: hidden;
  color: var(--ui-ink);
  font-family: var(--ui-font-display);
  font-size: var(--type-page);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appShell.ui-workspace .workspace-section-heading {
  margin: 12px 0 0;
  padding: 4px 2px 0;
  grid-column: 1 / -1;
}

#appShell.ui-workspace .workspace-section-heading > span {
  display: block;
  color: var(--ui-blue);
  font-size: var(--type-caption);
  font-weight: 720;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

#appShell.ui-workspace .workspace-section-heading h2 {
  margin: 5px 0 0;
  color: var(--ui-ink);
  font-family: var(--ui-font-sans);
  font-size: var(--type-section);
  font-weight: 710;
  letter-spacing: -0.028em;
}

#appShell.ui-workspace .workspace-section-heading p {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--ui-ink-secondary);
  font-size: var(--type-body);
  line-height: 1.5;
}

/* !important in the rule below: it beats the base styles and the page header rules and others. */
#appShell.ui-workspace .workspace-legacy-heading,
#appShell.ui-workspace .workspace-legacy-title {
  display: none !important;
}

@media (max-width: 1000px) {
  #appShell.ui-workspace .workspace-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #appShell.ui-workspace .workspace-page-aside {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
  }

  #appShell.ui-workspace .integration-page-toolbar {
    width: 100%;
    min-width: 0;
    align-items: stretch;
  }

  #appShell.ui-workspace .integration-page-status,
  #appShell.ui-workspace .integration-page-actions {
    justify-content: flex-start;
  }

  #appShell.ui-workspace .workspace-page-actions,
  #appShell.ui-workspace .workspace-page-statuses {
    justify-content: flex-start;
  }

  #appShell.ui-workspace .workspace-summary-grid,
  #appShell.ui-workspace #paneSecurity > .workspace-summary-grid {
    grid-template-columns: 1fr;
  }
}

#appShell.ui-workspace .integration-connection-card {
  padding: 16px 18px;
}

#appShell.ui-workspace .integration-connection-card .pane-meta {
  width: 100%;
  max-width: 520px;
  margin-top: 0;
}


#appShell.ui-workspace .source-summary-top {display:flex;align-items:center;justify-content:space-between;gap:20px;padding:15px 18px;border-left:4px solid var(--ui-blue);background:var(--ui-blue-soft)}
#appShell.ui-workspace .source-summary-file {min-width:0;max-width:100%;text-align:left;padding:0;border:0;background:none;box-shadow:none;color:var(--ui-ink);white-space:normal}
#appShell.ui-workspace .source-summary-file small {display:block;color:var(--ui-ink-secondary);font-size:var(--type-caption)}
#appShell.ui-workspace .source-summary-file strong {display:block;font-size:var(--type-emphasis);overflow-wrap:anywhere}
#appShell.ui-workspace .source-summary-file:hover strong {text-decoration:underline}
#appShell.ui-workspace .source-summary-rules {display:flex;flex-wrap:wrap;gap:8px 18px;font-size:var(--type-body);color:var(--ui-ink-secondary)}
#appShell.ui-workspace .source-summary-filters {display:flex;flex-wrap:wrap;gap:4px;padding:7px 10px}
#appShell.ui-workspace .source-summary-filters button {display:flex;align-items:center;justify-content:center;gap:7px;flex:1 0 auto;min-height:44px;padding:9px 12px;border:1px solid transparent;border-radius:7px;background:none;color:var(--ui-ink);box-shadow:none;font-size:var(--type-body);white-space:nowrap}
#appShell.ui-workspace .source-summary-filters button b {font-size:var(--type-emphasis);font-variant-numeric:tabular-nums}
#appShell.ui-workspace .source-summary-filters button:hover {background:var(--ui-blue-soft)}
#appShell.ui-workspace .source-summary-filters button[aria-pressed="true"] {color:var(--ui-blue);background:var(--ui-blue-soft);border-color:var(--ui-blue)}
#appShell.ui-workspace .source-summary-note,#appShell.ui-workspace .source-summary-warning {padding:8px 18px;margin:0;border-top:1px solid var(--ui-line);font-size:var(--type-caption);color:var(--ui-ink-secondary)}
#appShell.ui-workspace .source-summary-warning {color:var(--ui-ink);font-weight:600}
.source-summary-dialog {width:min(780px,calc(100vw - 32px));max-height:85dvh;overflow:auto;border:1px solid var(--ui-grey-200,#dce5ef);border-radius:14px;padding:24px;background:#fff;color:var(--ui-grey-900,#192536)}
.source-summary-dialog::backdrop {background:rgb(15 23 42 / 40%)}
.source-summary-dialog h2 {margin:0 0 18px;font-size:var(--type-section,20px)}.source-summary-dialog p {overflow-wrap:anywhere}
.source-summary-pages {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0}
.source-summary-scroll {overflow-x:auto;margin:18px 0}.source-summary-dialog table {width:100%;min-width:480px;border-collapse:collapse}.source-summary-dialog :is(th,td) {padding:12px;text-align:left;border-bottom:1px solid var(--ui-grey-200,#dce5ef);color:inherit;background:transparent;overflow-wrap:anywhere}
body[data-app-theme="dark"]:not(#_) .source-summary-dialog, body #appShell[data-ui-theme="dark"] .source-summary-dialog {background:var(--ui-grey-surface);color:var(--ui-grey-900);border-color:var(--ui-grey-300)}
body[data-app-theme="dark"]:not(#_) .source-summary-dialog :is(th,td), body #appShell[data-ui-theme="dark"] .source-summary-dialog :is(th,td) {border-color:var(--ui-grey-300)}
@media(max-width:760px){#appShell.ui-workspace .source-summary-top {align-items:flex-start;flex-direction:column;gap:10px}#appShell.ui-workspace .source-summary-filters button {flex:1 0 40%}}

#appShell.ui-workspace :where(#paneImport, #paneInvoice, #panePointOfSale, #paneMarketplaceSync) :where(
  #qbBillTableWrap,
  #invoiceTableWrap,
  #importMatchTableWrap,
  #invoiceMatchTableWrap,
  #marketplaceSyncBatchWrap,
  #marketplaceSyncPreviewWrap,
  .pos-results-table
) thead th {
  position: sticky;
  top: 0;
  z-index: 2;

}

.workspace-progress {
  position:fixed;inset:auto 16px 24px;margin:0 auto;width:max-content;max-width:calc(100vw - 32px);
  display:flex;align-items:center;gap:14px;padding:16px 22px;z-index:2147483000;
  background:#fff;color:var(--ui-grey-900,#1c2738);border:1px solid var(--ui-grey-200,#dce3ec);border-radius:14px;
  box-shadow:0 12px 40px #17243826;font:var(--type-body,14px)/1.5 var(--workspace-font-sans,system-ui);
}
.workspace-progress[hidden] {display:none}
.workspace-progress[data-notice-suspended="true"] {display:none}
/* All shared notices use the same compact operation-pill surface. Only the
   active notice paints; queued messages keep their full reading time. */
#toast {bottom:max(24px,env(safe-area-inset-bottom));width:max-content;max-width:calc(100vw - 32px);display:flex;flex-direction:column;align-items:center;gap:12px}
#toast[hidden],#toast.u-hidden {display:none}
.workspace-progress small {display:block;max-width:390px;margin-top:4px;color:var(--ui-grey-600,#66758c)}
.workspace-progress .rv-progress-spinner {display:block;width:22px;height:22px;flex-shrink:0;border:3px solid var(--ui-grey-200,#e2eaf5);border-top-color:#1975f0;border-radius:50%;animation:workspace-progress-spin .8s linear infinite}
body[data-app-theme="dark"]:not(#_) .workspace-progress, body #appShell[data-ui-theme="dark"] .workspace-progress {background:var(--ui-grey-surface);color:var(--ui-grey-900);border-color:var(--ui-grey-300)}
body[data-app-theme="dark"]:not(#_) .workspace-progress small, body #appShell[data-ui-theme="dark"] .workspace-progress small {color:var(--ui-grey-600)}
@media(prefers-reduced-motion:reduce){.workspace-progress .rv-progress-spinner{animation:none}}


#appShell.ui-workspace :where(#paneImport, #paneInvoice, #panePointOfSale) :where(.u-confirm-bar, #posActionMessage) {
  border-radius: 13px;
}


/* Organized utility and tracking workspaces ---------------------------- */

#appShell.ui-workspace .workspace-card-grid:not([hidden]):not(.u-hidden) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

#appShell.ui-workspace .workspace-card-grid > :not(.workspace-role-card) {
  grid-column: 1 / -1;
}

#appShell.ui-workspace .workspace-card-grid > .workspace-role-card {
  min-width: 0;
  height: 100%;
  margin: 0;
}

#appShell.ui-workspace .workspace-card-grid > :where(
  .workspace-card-overview,
  .workspace-card-insight,
  .workspace-card-analytics,
  .workspace-card-notice,
  .workspace-card-notifications,
  .workspace-card-editor,
  .workspace-card-actions,
  .workspace-card-list,
  .workspace-card-guide,
  .workspace-card-workflow,
  .workspace-card-resources,
  .workspace-card-search
) {
  grid-column: 1 / -1;
}

#appShell.ui-workspace .workspace-card-grid-downloads > .workspace-card-download {
  grid-column: auto;
}

#appShell.ui-workspace .workspace-card-stack > .workspace-role-card {
  margin-bottom: 14px;
}

#appShell.ui-workspace .workspace-role-card {
  overflow: hidden;
}

#appShell.ui-workspace :where(
  .workspace-role-card,
  .integration-connection-card,
  .integration-picker-card,
  .integration-provider-card,
  .integration-workflow-card,
  .integration-completed-card,
  .recon-setup-panel
):hover {
  border-color: var(--ui-line);
  box-shadow: var(--ui-shadow-sm);
  transform: none;
}

#appShell.ui-workspace .workspace-role-card > :where(.u-section-header, .dashboard-spotlight-header, .marketplace-downloads-header, .terms-card-header) {
  margin: -18px -18px 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--ui-line);
}

#appShell.ui-workspace .workspace-card-overview {
  border-color: color-mix(in srgb, var(--ui-blue) 14%, var(--ui-line));
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--ui-blue) 9%, transparent), transparent 26rem),
    var(--ui-surface);
}

#appShell.ui-workspace :where(.workspace-card-reference, .workspace-card-insight, .workspace-card-notice, .workspace-card-source, .workspace-card-download) {
  background: color-mix(in srgb, var(--ui-surface) 88%, var(--ui-surface-muted));
}

#appShell.ui-workspace .workspace-card-list :where(.contracts-table-wrap, .terms-table-wrap, .dashboard-metrics-table, [class*="table-wrap"]) {
  max-height: 540px;
  overflow: auto;
}

#appShell.ui-workspace .workspace-card-list thead th {
  position: sticky;
  top: 0;
  z-index: 2;

}

#appShell.ui-workspace .workspace-card-download {
  min-height: 190px;
}

#appShell.ui-workspace .workspace-card-download :where(.marketplace-downloads-header, .u-section-header) {
  min-height: 58px;
  align-items: center;
}

@media (max-width: 900px) {
  #appShell.ui-workspace .workspace-card-grid:not([hidden]):not(.u-hidden) {
    grid-template-columns: 1fr;
  }

  #appShell.ui-workspace .workspace-card-grid-downloads > .workspace-card-download {
    grid-column: 1;
  }
}

/* Completed reconciliation review workspaces ------------------------- */

/* !important in the rule below: it beats the base styles and the page header rules and others. */
#appShell.ui-workspace .recon-results-stage[hidden] {
  display: none !important;
}

#appShell.ui-workspace .recon-change-inputs {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: var(--type-body);
}

#appShell.ui-workspace .recon-results-stage {
  margin: 0 0 16px;
}

#appShell.ui-workspace .recon-result-sources {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#appShell.ui-workspace .recon-result-sources article {
  min-width: 0;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

#appShell.ui-workspace .recon-source-symbol {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: var(--type-caption);
  font-style: normal;
  font-weight: 760;
}

#appShell.ui-workspace .recon-source-symbol.is-blue {
  background: var(--ui-blue-soft);
  color: var(--ui-blue);
}

#appShell.ui-workspace .recon-source-symbol.is-violet {
  background: color-mix(in srgb, var(--ui-violet) 11%, transparent);
  color: var(--ui-violet);
}

#appShell.ui-workspace .recon-result-sources article > span:nth-child(2),
#appShell.ui-workspace .recon-result-sources :where(small, strong, em) {
  min-width: 0;
  display: block;
}

#appShell.ui-workspace .recon-result-sources small {
  color: var(--ui-ink-tertiary);
  font-size: var(--type-caption);
  font-weight: 720;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

#appShell.ui-workspace .recon-result-sources strong {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ui-ink);
  font-size: var(--type-body);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appShell.ui-workspace .recon-result-sources em {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ui-ink-tertiary);
  font-size: var(--type-caption);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appShell.ui-workspace .recon-result-sources article > b {
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-green) 10%, transparent);
  color: var(--ui-green);
  font-size: var(--type-body);
  letter-spacing: 0.03em;
}

#appShell.ui-workspace .recon-results-stage #statsCard {
  margin: 0 0 14px;
  padding: 10px;
  border-radius: 16px;
}

#appShell.ui-workspace .recon-results-stage #statsCard .statsbar {
  display: block;
}

#appShell.ui-workspace .recon-results-stage #statsCard .stats {
  gap: 4px;
}

#appShell.ui-workspace .recon-results-stage #statsCard .stat,
#appShell.ui-workspace .recon-results-stage #mpTotals .stat {
  min-width: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

#appShell.ui-workspace .recon-results-stage #statsCard .stat:hover,
#appShell.ui-workspace .recon-results-stage #statsCard .stat.active,
#appShell.ui-workspace .recon-results-stage #mpTotals .stat:hover,
#appShell.ui-workspace .recon-results-stage #mpTotals .stat.active {
  background: var(--ui-blue-soft);
}

#appShell.ui-workspace .recon-results-stage #statsCard .stat .value,
#appShell.ui-workspace .recon-results-stage #mpTotals .stat .value {
  margin-top: 4px;
  font-size: var(--type-emphasis);
}

#appShell.ui-workspace .recon-results-stage #sparkBox {
  display: none;
}

#appShell.ui-workspace .recon-results-stage #statsCard .stats-actions {
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--ui-line);
}

#appShell.ui-workspace .recon-results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

#appShell.ui-workspace .recon-results-table-card {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}

#appShell.ui-workspace #previewCard > .bar,
#appShell.ui-workspace #marketplaceCard > .mp-filter-bar,
#appShell.ui-workspace #marketplaceCard > .u-section-header {
  margin: 0;
  padding: 14px 15px;
  border-bottom: 1px solid var(--ui-line);
}

#appShell.ui-workspace #mpResultsPager {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  padding:14px 15px;
  border-top:1px solid var(--ui-line);
  background:var(--ui-surface-solid);
}
#appShell.ui-workspace #mpResultsPager[hidden] {display:none;}
#appShell.ui-workspace #mpResultsPager [role="status"] {margin-left:auto;font-size:var(--type-caption);}

/* UI #24: status chips with counts replace the five status cards; the three totals cards stay and still sort. */
#marketplaceCard #mpTotals .stat[data-filter] {display:none;}
#mpTotals .stat .sort-indicator {margin-left:6px;opacity:.7;}
#mpTotals .stat.active .sort-indicator {opacity:1;}
#mpTotals .stat .mp-sort-caption {display:block;margin-top:2px;font-size:var(--type-caption);color:var(--ui-ink-secondary,var(--muted));}
#statsCard .stat .stat-caption {display:block;margin-top:2px;font-size:var(--type-caption);color:var(--ui-ink-secondary,var(--muted));}
#appShell.ui-workspace #marketplaceCard #mpTotals {grid-template-columns:repeat(3,minmax(0,1fr));}
#marketplaceCard > .mp-filter-bar {display:grid;gap:8px;justify-items:start;}
#marketplaceCard .mp-status-chips {display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;}
#marketplaceCard .mp-status-chips[hidden] {display:none;}
#marketplaceCard .mp-status-chip {display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:4px 12px;border:1px solid var(--ui-line-strong,var(--border));border-radius:999px;background:var(--ui-surface-solid,var(--card));box-shadow:none;color:var(--ui-ink,var(--text));font:inherit;font-size:var(--type-caption,13px);font-weight:600;line-height:1.2;white-space:nowrap;cursor:pointer;}
#marketplaceCard .mp-status-chip b {font-weight:700;font-variant-numeric:tabular-nums;color:var(--ui-ink-secondary,var(--muted));}
#marketplaceCard .mp-status-chip:hover:not(:disabled) {border-color:var(--ui-blue,var(--accent));}
#marketplaceCard .mp-status-chip:focus-visible {outline:2px solid var(--ui-blue,#1671ec);outline-offset:2px;}
#marketplaceCard .mp-status-chip[aria-pressed="true"],
#marketplaceCard .mp-status-chip[aria-pressed="true"] b {background:var(--ui-blue,var(--accent));border-color:var(--ui-blue,var(--accent));color:#fff;}
#appShell[data-ui-theme="dark"] #marketplaceCard .mp-status-chip[aria-pressed="true"],
#appShell[data-ui-theme="dark"] #marketplaceCard .mp-status-chip[aria-pressed="true"] b {color:var(--ui-surface-solid,var(--ui-grey-100));}
#marketplaceCard .mp-status-chip:disabled {cursor:default;color:var(--ui-ink-secondary,var(--muted));background:transparent;border-color:var(--ui-line,var(--border));}
#marketplaceCard .mp-status-chip.is-problems:not([aria-pressed="true"]):not(:disabled) {border-color:color-mix(in srgb,var(--ui-amber,#b7791f) 55%,var(--ui-line,var(--border)));background:color-mix(in srgb,var(--ui-amber,#b7791f) 10%,var(--ui-surface-solid,var(--card)));}
@media (max-width: 900px) {#appShell.ui-workspace #marketplaceCard #mpTotals {grid-template-columns:1fr;}}

#appShell.ui-workspace #previewCard > .quick,
#appShell.ui-workspace #marketplaceCard > .quick {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-surface-muted);
}
#appShell.ui-workspace :is(#previewCard, #marketplaceCard) > .quick > small {
  flex-basis: 100%;
}

@media (max-width: 600px) {
  #appShell.ui-workspace :is(#previewCard, #marketplaceCard) > .quick > div {
    flex: 1 1 100%;
    min-width: 0;
  }
  #appShell.ui-workspace :is(#previewCard, #marketplaceCard) > .quick > .range {
    flex-wrap: wrap;
  }
  #appShell.ui-workspace :is(#previewCard, #marketplaceCard) > .quick > .range > div {
    flex: 1 1 100%;
    min-width: 0;
  }
  #appShell.ui-workspace :is(#previewCard, #marketplaceCard) > .quick input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  #appShell.ui-workspace :is(#previewCard, #marketplaceCard) > .quick > .controls {
    flex-wrap: wrap;
  }
  #appShell.ui-workspace :is(#previewCard, #marketplaceCard) > .quick > .controls button {
    flex: 1 1 100%;
  }
}

#appShell.ui-workspace #marketplaceCard #mpTotals {
  margin: 0;
  padding: 5px 9px;
  gap: 2px;
  border-bottom: 1px solid var(--ui-line);
}

/* !important in the next 2 rules that use it: it beats the drawer and dialog rules and the shared component rules and others. */
#appShell.ui-workspace .recon-results-stage :where(#previewScroll, #marketplaceScroll) {
  max-height: min(650px, calc(100vh - 265px));
  border: 0 !important;
  border-radius: 0 !important;
}

#appShell.ui-workspace .recon-results-stage .contracts-table {
  border-collapse: separate;
  border-spacing: 0;
}

#appShell.ui-workspace .recon-results-stage .contracts-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;

  color: var(--ui-ink-tertiary);
  font-size: var(--type-caption);
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

#appShell.ui-workspace .recon-results-stage .contracts-table tbody tr:not(.invest) {
  cursor: pointer;
  transition: background-color 120ms ease;
}

#appShell.ui-workspace .recon-results-stage .contracts-table tbody tr:not(.invest):hover,
#appShell.ui-workspace .recon-results-stage .contracts-table tbody tr.is-review-selected {
  background: var(--ui-blue-soft) !important;
}

#appShell.ui-workspace .recon-results-stage .contracts-table td {
  height: 48px;
  color: var(--ui-ink-secondary);
  font-size: var(--type-body);
}

@media (max-width: 680px) {
  #appShell.ui-workspace .recon-result-sources {
    grid-template-columns: 1fr;
  }

}

#appShell.ui-workspace .workspace-page .contracts-table-wrap{
  overflow: auto;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface-solid);
}

#appShell.ui-workspace .contracts-table tfoot .contracts-totals-row td {
  border-color: var(--ui-line);
  background: var(--ui-surface-muted);
  color: var(--ui-red);
}

#appShell.ui-workspace #paneHowTo .dashboard-howto-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

#appShell.ui-workspace #paneTemplates .dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1120px) {

  #appShell.ui-workspace #paneHowTo .dashboard-howto-sections,
  #appShell.ui-workspace #paneTemplates .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #appShell.ui-workspace :where(#paneSeasonSeats, #paneCanceledEvents, #paneCreditCards, #paneContracts) .contracts-summary-metrics,
#appShell.ui-workspace #paneHowTo .dashboard-howto-sections,
#appShell.ui-workspace #paneTemplates .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

#appShell.ui-workspace .recon-page-head {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

#appShell.ui-workspace .recon-status-grid {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#appShell.ui-workspace #statsCard,
#appShell.ui-workspace #marketplaceCard {
  border-radius: 18px;
}

#appShell.ui-workspace #statsCard .stats,
#appShell.ui-workspace #mpTotals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#appShell.ui-workspace #previewCard,
#appShell.ui-workspace #marketplaceCard {
  overflow: hidden;
}

#appShell.ui-workspace #previewCard #previewScroll,
#appShell.ui-workspace #marketplaceCard #marketplaceScroll {
  max-height: 520px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface-solid);
}

#appShell.ui-workspace #marketplaceCard #marketplaceScroll {
  margin-top: 0;
}

#appShell.ui-workspace #marketplaceCard .u-section-header {
  margin-bottom: 12px;
}

#appShell.ui-workspace #paneConnections .connections-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}

#appShell.ui-workspace #poPosWrap .purchase-pos-source-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(130px, .7fr) minmax(190px, 1.2fr) repeat(2, minmax(150px, .8fr));
  gap: 11px;
}

#appShell.ui-workspace input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  padding: 6px 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 9px;
  background: var(--ui-surface-solid);
  color: var(--ui-ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

#appShell.ui-workspace input[type="file"]::file-selector-button:hover {
  border-color: color-mix(in srgb, var(--ui-blue) 28%, var(--ui-line-strong));
  background: var(--ui-blue-soft);
}

#appShell.ui-workspace :where(
  .security-message,
  .connections-hub-message,
  .dashboard-missing-manual-message,
  .marketplace-pos-load-status,
  .modal-message
):not(:empty) {
  min-height: 36px;
  padding: 9px 11px;
  border: 1px solid var(--ui-line);
  border-radius: 11px;
  background: var(--ui-surface-muted);
  color: var(--ui-ink-secondary);
  font-size: var(--type-caption);
  line-height: 1.45;
}

#appShell.ui-workspace :where(.security-message.is-success, .connections-hub-message.is-success, .modal-message.success),
#appShell.ui-workspace .marketplace-pos-load-status[data-state="success"] {
  border-color: color-mix(in srgb, var(--ui-green) 24%, var(--ui-line));
  background: var(--ui-green-soft);
  color: var(--ui-green);
}

#appShell.ui-workspace :where(.security-message.is-warn, .modal-message.warn) {
  border-color: color-mix(in srgb, var(--ui-amber) 24%, var(--ui-line));
  background: var(--ui-amber-soft);
  color: var(--ui-amber);
}

#appShell.ui-workspace :where(.security-message.is-error, .connections-hub-message.is-error, .modal-message.error),
#appShell.ui-workspace .marketplace-pos-load-status[data-state="empty"],
#appShell.ui-workspace .marketplace-pos-load-status[data-state="error"] {
  border-color: color-mix(in srgb, var(--ui-red) 22%, var(--ui-line));
  background: var(--ui-red-soft);
  color: var(--ui-red);
}

#appShell.ui-workspace .status-legend-item {
  padding: 12px 13px;
  border: 1px solid var(--ui-line);
  border-radius: 13px;
  background: var(--ui-surface-muted);
}

#appShell.ui-workspace .status-legend-dot {
  box-shadow: none;
}

/* Color remains purposeful: selection, workflow identity, and record outcome. */
#appShell.ui-workspace :where(.badge.exact, .badge.info) {
  border-color: color-mix(in srgb, var(--ui-green) 30%, var(--ui-line));
  background: var(--ui-green-soft);
  color: var(--ui-green);
}

#appShell.ui-workspace :where(.badge.near, .badge.ok) {
  border-color: color-mix(in srgb, var(--ui-amber) 32%, var(--ui-line));
  background: var(--ui-amber-soft);
  color: var(--ui-amber);
}

#appShell.ui-workspace .badge.none {
  border-color: color-mix(in srgb, var(--ui-red) 30%, var(--ui-line));
  background: var(--ui-red-soft);
  color: var(--ui-red);
}

#appShell.ui-workspace :where(tr.row-exact, tr.row-near, tr.row-ok, tr.row-none) > td:first-child {
  box-shadow: inset 3px 0 0 transparent;
}

#appShell.ui-workspace tr.row-exact > td:first-child {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--ui-green) 72%, transparent);
}

#appShell.ui-workspace :where(tr.row-near, tr.row-ok) > td:first-child {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--ui-amber) 72%, transparent);
}

#appShell.ui-workspace tr.row-none > td:first-child {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--ui-red) 68%, transparent);
}

#appShell.ui-workspace :where(.stat .value, .dashboard-metric-value).ok {
  color: var(--ui-green);
}

#appShell.ui-workspace :where(.stat .value, .dashboard-metric-value).near {
  color: var(--ui-blue);
}

#appShell.ui-workspace :where(.stat .value, .dashboard-metric-value).warn {
  color: var(--ui-amber);
}

#appShell.ui-workspace :where(.stat .value, .dashboard-metric-value).err {
  color: var(--ui-red);
}

/* !important in the next 7 rules that use it: it beats the shared status, message and sidebar rules and the drawer and dialog rules and others. */
#appShell.ui-workspace table tbody tr:nth-child(odd):not(:hover) > :is(td, th) {
  background: var(--table-stripe-odd) !important;
}

#appShell.ui-workspace table tbody tr:nth-child(even):not(:hover) > :is(td, th) {
  background: var(--table-stripe-even) !important;
}

#appShell.ui-workspace table tbody :is(td, th) {
  transition: background-color 80ms ease, box-shadow 80ms ease;
}

#appShell.ui-workspace table tbody tr:is(.row-exact, .row-info):not(:hover) > :is(td, th) {
  background: var(--table-row-success) !important;
}

#appShell.ui-workspace table tbody tr:is(.row-near, .row-ok):not(:hover) > :is(td, th) {
  background: var(--table-row-warning) !important;
}

#appShell.ui-workspace table tbody tr.row-none:not(:hover) > :is(td, th) {
  background: var(--table-row-error) !important;
}

#appShell.ui-workspace table tbody tr:hover > :is(td, th) {
  background: var(--table-row-hover) !important;
}

#appShell.ui-workspace table tbody tr:is(.is-selected, .is-review-selected, [aria-selected="true"]):not(:hover) > :is(td, th),
#appShell.ui-workspace table tbody tr:has(input[type="checkbox"]:checked) > :is(td, th) {
  background: var(--table-row-selected) !important;
}

#appShell.ui-workspace table tbody tr:is(.is-selected, .is-review-selected, [aria-selected="true"]) > :first-child,
#appShell.ui-workspace table tbody tr:has(input[type="checkbox"]:checked) > :first-child {
  box-shadow: inset 3px 0 0 var(--ui-blue);
}

#appShell.ui-workspace table tbody tr.row-info > :first-child {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--ui-green) 72%, transparent);
}

/* One accent: every workspace page uses blue for "you are here"; sidebar icons carry no colour of their own. */
#appShell.ui-workspace :where(#btnRecon, #btnMarketplace, #btnMarketplaceSync, #btnMpTags, #btnTerms, #btnTwo, #btnMissing, #btnQuickbooks, #btnInvoice, #btnQboAccounts, #btnImport, #btnPointOfSale, #btnPointOfSaleTradeDesk, #btnConnections) {
  --workspace-item-accent: var(--ui-blue);
  --workspace-item-soft: var(--ui-blue-soft);
}

#appShell.ui-workspace .app-topnav-menu.workspace-nav-menu .workspace-nav-icon {
  width: 24px;
  height: 24px;
  margin-left: -2px;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--ui-surface-solid) 56%, var(--ui-surface-muted));
  color: var(--ui-ink-tertiary);
}

#appShell.ui-workspace :where(#btnRecon, #btnMarketplace, #btnMarketplaceSync, #btnMpTags, #btnTerms, #btnTwo, #btnMissing, #btnQuickbooks, #btnInvoice, #btnQboAccounts, #btnImport, #btnPointOfSale, #btnPointOfSaleTradeDesk, #btnConnections) .workspace-nav-icon {
  border: 1px solid color-mix(in srgb, var(--workspace-item-accent) 18%, var(--ui-line));
  background: var(--workspace-item-soft);
  color: var(--workspace-item-accent);
}

#appShell.ui-workspace .app-topnav-menu.workspace-nav-menu .workspace-nav-item.is-active {
  background: var(--ui-surface);
  border: 1px solid color-mix(in srgb, var(--workspace-item-accent, var(--ui-blue)) 20%, var(--ui-line));
  background: color-mix(in srgb, var(--workspace-item-accent, var(--ui-blue)) 10%, var(--ui-surface-solid));
  box-shadow: 0 1px 4px rgba(20, 30, 48, 0.08);
  color: var(--ui-ink);
}

#appShell.ui-workspace .workspace-nav-item.is-active .workspace-nav-icon {
  border-color: color-mix(in srgb, var(--workspace-item-accent, var(--ui-blue)) 38%, var(--ui-line));
  background: color-mix(in srgb, var(--workspace-item-accent, var(--ui-blue)) 16%, var(--ui-surface-solid));
  color: var(--workspace-item-accent, var(--ui-blue));
}

#appShell.ui-workspace .workspace-page .brand-status.is-connected,
#appShell.ui-workspace .workspace-page .brand-status.ok {
  border-color: color-mix(in srgb, var(--ui-green) 28%, var(--ui-line));
  background: var(--ui-green-soft);
  color: var(--ui-green);
}

#appShell.ui-workspace .workspace-page .brand-status.is-attention,
#appShell.ui-workspace .workspace-page .brand-status.is-disconnected {
  border-color: color-mix(in srgb, var(--ui-amber) 30%, var(--ui-line));
  background: var(--ui-amber-soft);
  color: var(--ui-amber);
}

#appShell.ui-workspace .workspace-page .brand-status.is-running {
  border-color: color-mix(in srgb, var(--ui-blue) 26%, var(--ui-line));
  background: var(--ui-blue-soft);
  color: var(--ui-blue);
}

#appShell.ui-workspace .workspace-page .brand-status.is-error {
  border-color: color-mix(in srgb, var(--ui-red) 28%, var(--ui-line));
  background: var(--ui-red-soft);
  color: var(--ui-red);
}

#appShell.ui-workspace code {
  padding: 3px 7px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface-muted);
  color: var(--ui-ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

#appShell.ui-workspace progress {
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--ui-surface-muted);
  color: var(--ui-blue);
  accent-color: var(--ui-blue);
}

#appShell.ui-workspace progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--ui-surface-muted);
}

#appShell.ui-workspace progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--ui-blue);
}

#appShell.ui-workspace progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--ui-blue);
}

#appShell.ui-workspace :where(.workspace-content, .table-wrap, [class*="table-wrap"], #previewScroll, #marketplaceScroll) {
  scrollbar-width: thin;
  scrollbar-color: var(--ui-line-strong) transparent;
}

#appShell.ui-workspace :where(.workspace-content, .table-wrap, [class*="table-wrap"], #previewScroll, #marketplaceScroll)::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#appShell.ui-workspace :where(.workspace-content, .table-wrap, [class*="table-wrap"], #previewScroll, #marketplaceScroll)::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--ui-line-strong);
  background-clip: padding-box;
}

@media (max-width: 1220px) {
  #appShell.ui-workspace #statsCard .stats,
  #appShell.ui-workspace #mpTotals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 900px) {

  #appShell.ui-workspace .recon-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #appShell.ui-workspace #paneConnections .connections-notification-grid,
  #appShell.ui-workspace #paneConnections .connections-notification-channels,
  #appShell.ui-workspace #poPosWrap .purchase-pos-source-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {

  #appShell.ui-workspace .workspace-page-head,
  #appShell.ui-workspace .recon-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  #appShell.ui-workspace #statsCard .stats,
  #appShell.ui-workspace #mpTotals,
  #appShell.ui-workspace .recon-status-grid,
  #appShell.ui-workspace #paneConnections .connections-hub-summary,
  #appShell.ui-workspace #paneConnections .connections-hub-grid {
    grid-template-columns: 1fr;
  }
}

#appShell.ui-workspace:not([data-ui-theme="dark"]) .app-topnav-menu.workspace-nav-menu .workspace-nav-item.is-active {
  border-color: color-mix(in srgb, var(--workspace-item-accent, var(--ui-blue)) 38%, var(--ui-line));
  background: color-mix(in srgb, var(--workspace-item-accent, var(--ui-blue)) 17%, var(--ui-surface-solid));
  box-shadow: inset 3px 0 0 var(--workspace-item-accent, var(--ui-blue));
}

#appShell.ui-workspace:not([data-ui-theme="dark"]) progress {
  background: var(--ui-grey-200);
}

#appShell.ui-workspace:not([data-ui-theme="dark"]) progress::-webkit-progress-bar {
  background: var(--ui-grey-200);
}

#appShell.ui-workspace #paneSecurity.my-security-page > :is(.workspace-page-head,.workspace-summary-grid,.security-account-card,.workspace-section-heading) { grid-column:1 / -1; }

#appShell.ui-workspace .utility-page > .workspace-page-head { padding:4px 0 22px; margin-bottom:6px; border-bottom:1px solid var(--ui-line); flex-wrap:wrap; }
#appShell.ui-workspace .utility-page > .workspace-page-head > div:first-child { flex:1 1 380px; min-width:0; }
#appShell.ui-workspace .utility-page > .workspace-section-heading { display:none; }
#appShell.ui-workspace .utility-page .workspace-page-badge { background:transparent; box-shadow:none; }
#appShell.ui-workspace .utility-page :is(.workspace-page-aside,.workspace-page-actions) { min-width:0; max-width:100%; flex-wrap:wrap; }
#appShell.ui-workspace .utility-page :is(.btn,.btn-outline,.chip-btn) { font-size:var(--type-body); line-height:1.4; border-radius:8px; padding:9px 13px; min-height:38px; height:auto; max-width:100%; white-space:normal; }
#appShell.ui-workspace .utility-page :is(input:not([type="checkbox"]),select) { min-width:0; max-width:100%; min-height:40px; border-radius:8px; font-size:var(--type-body); }
#appShell.ui-workspace .utility-page :is(button,a,input,select,summary):focus-visible { outline:2px solid var(--ui-blue); outline-offset:3px; }
#appShell.ui-workspace .utility-page .dashboard-heading::after { display:none; }
#appShell.ui-workspace .utility-page .dashboard-heading { padding-bottom:0; }
/* !important in the next 2 rules that use it: it beats the base styles and the rules in workspace-missing.css and others; some properties are also set inline by the app. */
#appShell.ui-workspace .utility-page [hidden] { display:none !important; }


@media(max-width:700px) {
  #appShell.ui-workspace .utility-page > .workspace-page-head { padding-bottom:16px; }
  #appShell.ui-workspace .utility-page > .workspace-page-head > div:first-child { flex:none; width:100%; }
}

/* Keep touch targets generous after applying compact workspace variants. */
@media (pointer: coarse) {
  #appShell.ui-workspace .workspace-page button:is(.btn, .btn-outline, .chip-btn, .workspace-mode-option),
  #appShell.ui-workspace #paneImportHub button:is(.btn, .btn-outline, .chip-btn),
  #appShell.ui-workspace .recon-center-switch .workspace-mode-option,
  body.auth-ready[data-app-shell]:not(#_) .modal :where(.btn, .btn-outline), body.auth-ready #appShell.ui-workspace .modal :where(.btn, .btn-outline) {
    min-height: 44px;
  }
}
body button.ui-dismiss-icon {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
  font-size: var(--type-page,22px) !important;
  font-weight: 400 !important;
}
