#tsunJourneyHome {
  touch-action: manipulation;
}

html[data-merchant-preview="locked"] body > :not(#merchantLogin):not(#merchantBuilderLoading):not(script):not(style) {
  visibility: hidden;
}

[data-merchant-preview] #checkout :is(
  .ts-policy-notice, .checkout-final-total, #checkoutFinalReference, #mobileCheckoutPricing,
  #tsunSpecificPaymentMethods, #paypalPaymentPanel, #stripePaymentPanel,
  #airwallexPaymentPanel, #localPostPaymentPreview
),
[data-merchant-preview] #confirm :is(#orderPricingDetails, .ts-policy-notice, .payment-profile-hint) {
  display: none !important;
}

[data-merchant-preview] .topbar {
  height: auto;
  min-height: 64px;
  padding-block: .625rem;
  gap: .75rem 1.5rem;
  flex-wrap: wrap;
}

[data-merchant-preview] .topbar .tsun-build-label {
  display: none;
}

[data-merchant-preview] .topbar nav,
[data-merchant-preview] .merchant-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .375rem .75rem;
}

[data-merchant-preview] .topbar nav {
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
}

[data-merchant-preview] .merchant-home-link,
[data-merchant-preview] .merchant-nav > :is(a, button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .375rem .625rem;
  color: #274a5e;
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

[data-merchant-preview] .merchant-home-link:hover,
[data-merchant-preview] .merchant-nav > :is(a, button):hover {
  background: #eaf5f9;
  border-radius: .625rem;
}

[data-merchant-preview] .merchant-name-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

[data-merchant-preview] #checkout :is(.section-title, .checkout-final-layout) {
  width: 100%;
  max-width: 54rem;
  margin-inline: auto;
}

[data-merchant-preview] #checkout .checkout-final-layout {
  grid-template-columns: minmax(0, 1fr);
}

[data-merchant-preview] #checkout .summary-card.payment-checkout {
  width: 100%;
  margin: 0;
  padding: clamp(1rem, 3vw, 2rem);
}

[data-merchant-preview] .merchant-nav[hidden],
[data-merchant-preview] #checkout [hidden] {
  display: none !important;
}

#merchantCheckoutForm {
  display: grid;
  gap: 1rem;
}

#merchantCheckoutForm :is(#customerEmailField, #postPaymentShippingForm, #merchantPreviewStatus) {
  margin: 0;
}

#merchantPreviewStatus:empty,
#merchantLoginStatus:empty {
  display: none;
}

.merchant-form-actions,
.merchant-receipt-actions,
#merchantCheckoutForm .merchant-edit-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .625rem;
  margin: 0;
}

.merchant-form-actions {
  justify-content: space-between;
}

#merchantCheckoutForm .merchant-edit-actions {
  justify-content: flex-start;
}

#merchantPreviewReceipt {
  display: grid;
  gap: 1.125rem;
}

#merchantReceiptStatus {
  margin: 0;
  padding: .875rem 1rem;
  border-radius: .75rem;
  background: #eef8f3;
  color: #1f5b47;
  line-height: 1.55;
}

.merchant-order-reference {
  display: grid;
  gap: .375rem;
  margin: 0;
}

.merchant-order-reference dt,
.merchant-receipt-profiles h3 {
  margin: 0;
  color: #234250;
  font-weight: 700;
  font-size: 1rem;
}

.merchant-order-reference dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #425e6c;
}

#merchantProfileLinks {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  padding: 0;
  margin: .5rem 0 0;
  list-style: none;
}

#merchantProfileLinks a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #17604e;
}

#merchantReceiptReview {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

@media (max-width: 640px) {
  [data-merchant-preview] .topbar nav {
    justify-content: flex-start;
  }

  .merchant-form-actions > #merchantSubmit,
  .merchant-receipt-actions > :is(a, button) {
    width: 100%;
  }
}

#merchantLogin {
  width: min(calc(100% - 2rem), 27rem);
  box-sizing: border-box;
  border: 1px solid #dbe6e9;
  border-radius: 1rem;
  padding: 1.5rem;
  background: white;
  color: #234250;
}

#merchantLogin form {
  display: grid;
  gap: 0.75rem;
}
#merchantLogin h2, #merchantLogin p {
  margin: 0;
}

#merchantLogin input {
  width: 100%;
}

#merchantOrderReview {
  box-sizing: border-box;
  max-width: 74rem;
  padding: 2rem 1rem;
  margin: auto;
  color: #234250;
}

#merchantOrderReview nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}

#merchantOrderReview a {
  color: #17604e;
}

#merchantOrderReview table {
  width: 100%;
  background: white;
  border-collapse: collapse;
  overflow-wrap: anywhere;
}

#merchantOrderReview :is(th, td) {
  text-align: left;
  padding: .7rem;
  border-bottom: 1px solid #dce8eb;
}

#merchantOrderReview > div > section {
  margin: 1.25rem 0 2rem;
}

.merchant-order-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

.merchant-order-overview section,
.merchant-order-operations {
  background: white;
  border: 1px solid #dce8eb;
  border-radius: .75rem;
  padding: 1rem;
}

.merchant-order-overview h2,
.merchant-order-operations h2 {
  font-size: 1.125rem;
  margin: 0 0 .75rem;
}

.merchant-order-details dl {
  display: grid;
  gap: .75rem;
}

.merchant-order-details dt {
  font-weight: 700;
}

.merchant-order-details dd {
  margin: .25rem 0 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.merchant-order-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
}

.merchant-production-list {
  display: grid;
  gap: .75rem;
  padding: 0;
  list-style: none;
}

.merchant-production-list > li {
  display: grid;
  gap: .625rem;
  padding: 1rem;
  border: 1px solid #dce8eb;
  border-radius: .75rem;
  background: white;
}

.merchant-production-downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: .75rem;
}

.merchant-production-downloads button {
  justify-self: start;
}

.merchant-production-downloads figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dce8eb;
  border-radius: .5rem;
}

.merchant-production-downloads img {
  display: block;
  width: 100%;
  height: 9rem;
  object-fit: contain;
  padding: .5rem;
  background: conic-gradient(#fff 25%, #e9f0f2 0 50%, #fff 0 75%, #e9f0f2 0) 0 0 / 1rem 1rem;
}

.merchant-production-downloads figcaption {
  display: grid;
  gap: .25rem;
  padding: .65rem;
}

.merchant-production-list summary {
  cursor: pointer;
}

.merchant-tag-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
}

.merchant-tag-gallery figure {
  margin: 0;
  padding: 1rem;
  border: 1px solid #dce8eb;
  border-radius: .75rem;
  background: white;
}

.merchant-tag-gallery img {
  width: 100%;
  max-width: 350px;
  height: auto;
  display: block;
  margin: .75rem auto 0;
}

.merchant-history-table {
  overflow-x: auto;
  border: 1px solid #dce8eb;
  border-radius: .75rem;
}

.merchant-history-table th {
  background: #eff6f8;
}

#merchantOrderReview .merchant-history-table :is(td, th):nth-child(-n+2) {
  white-space: nowrap;
}

.merchant-history-table td:first-child a {
  font-weight: 700;
}

.merchant-order-reference {
  color: #516b78;
  overflow-wrap: anywhere;
}

.merchant-sales-filters {
  display: flex;
  align-items: end;
  gap: .75rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}

.merchant-sales-filters label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .35rem;
  min-width: 10rem;
  flex: 1 1 10rem;
  font-weight: 650;
}

.merchant-sales-filters label[hidden] {
  display: none;
}

.merchant-sales-filters :is(select, input, button) {
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border: 1px solid #c9dde3;
  border-radius: .5rem;
  background: white;
  color: inherit;
  font: inherit;
}

.merchant-sales-filters :is(select, input) {
  width: 100%;
  min-width: 0;
}

.merchant-sales-filters button {
  background: #214c5e;
  color: white;
  cursor: pointer;
  font-weight: 650;
  min-width: 5rem;
}

.merchant-sales-metrics,
.merchant-sales-grid {
  display: grid;
  gap: .85rem;
}

.merchant-sales-metrics {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  margin: 0;
}

.merchant-sales-metrics > div,
#merchantOrderReview .merchant-sales-card {
  min-width: 0;
  background: white;
  border: 1px solid #dce8eb;
  border-radius: .75rem;
  padding: 1rem;
  margin: 0;
}

.merchant-sales-metrics dd {
  margin: .25rem 0 0;
  font-size: 1.6rem;
  font-weight: 720;
}

.merchant-sales-peak {
  margin: 1.1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .8rem;
}

.merchant-sales-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  margin-top: 1.1rem;
}

.merchant-sales-card h2 {
  margin: 0 0 .85rem;
  font-size: 1.15rem;
}

.merchant-sales-card ul {
  display: grid;
  gap: .8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.merchant-sales-card li > div:first-child {
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .25rem;
}

.merchant-sales-card strong {
  white-space: nowrap;
}

.merchant-sales-bar {
  height: .4rem;
  border-radius: .25rem;
  background: #e5f0f3;
  overflow: hidden;
}

.merchant-sales-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #438597;
}

.merchant-sales-scope {
  color: #516b78;
  font-size: .9rem;
  margin: 1rem 0 0;
}

.merchant-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem 1rem;
}

.merchant-review-header h1 {
  margin: 0;
}

body.merchant-portal {
  margin: 0;
  background: #f5fafb;
  color: #234250;
  font: 1rem/1.5 system-ui, sans-serif;
}

.merchant-portal [hidden] {
  display: none !important;
}

.merchant-portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .75rem max(1rem, calc((100% - 72rem) / 2));
  background: white;
  border-bottom: 1px solid #dce8eb;
}

.merchant-portal-header > a {
  color: inherit;
  font-weight: 750;
  letter-spacing: .08em;
  text-decoration: none;
}

.merchant-portal-header-actions,
.merchant-portal-menu {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
}

.merchant-portal-card {
  width: min(30rem, calc(100% - 2rem));
  box-sizing: border-box;
  margin: clamp(1rem, 8vh, 5rem) auto;
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid #dce8eb;
  border-radius: 1rem;
  background: white;
}

.merchant-portal-card h1 {
  margin: 0 0 1rem;
}

.merchant-portal-card form {
  display: grid;
  gap: .65rem;
}

.merchant-portal-card input,
.merchant-portal button,
.merchant-portal-menu .primary {
  box-sizing: border-box;
  min-height: 44px;
  border: 1px solid #c9dde3;
  border-radius: .65rem;
  padding: .5rem .75rem;
  background: white;
  color: inherit;
  font: inherit;
}

.merchant-portal button:disabled {
  cursor: wait;
  opacity: .65;
}

.merchant-portal .primary {
  background: #214c5e;
  color: white;
  font-weight: 650;
}

.merchant-portal-menu .primary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.merchant-portal-card a:not(.primary) {
  color: #17604e;
}

.merchant-history-filters > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.merchant-row-controls {
  min-width: 8rem;
}

.merchant-row-amount label {
  display: grid;
  gap: .2rem;
  margin-top: .4rem;
  font-size: .875rem;
}

.merchant-row-controls :is(select, input) {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: .4rem .5rem;
  border: 1px solid #c9dde3;
  border-radius: .5rem;
  color: inherit;
  background: white;
  font: inherit;
}

.merchant-portal .merchant-history-filters button {
  background: #214c5e;
  color: white;
  font-weight: 650;
}

.merchant-row-controls p {
  margin: .3rem 0 0;
  font-size: .875rem;
}

.merchant-row-controls p:empty {
  display: none;
}

#merchantPortalStatus:empty {
  display: none;
}

#merchantPortalRetry {
  display: inline-block;
  margin-top: .65rem;
}


#merchantBuilderLoading {
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 2rem 1rem;
  background: #f5fafb;
  color: #234250;
  text-align: center;
}

#merchantBuilderLoading a {
  display: block;
  margin-top: .75rem;
}

.merchant-artwork-frame {
  position: fixed;
  top: 0;
  left: -1200px;
  width: 1000px;
  height: 800px;
  border: 0;
  visibility: hidden;
  pointer-events: none;
}
