:root {
  font-family: Arial, sans-serif;
  color: #222;
  background: #f6f7f9;
}

* { box-sizing: border-box; }

body { margin: 0; }

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

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

h1, h2 { margin: 0 0 12px; }

h1 { font-size: 28px; }

h2 {
  font-size: 18px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

h2:first-child {
  border-top: 0;
  padding-top: 0;
}

.muted { color: #667; margin: 0; }

.status {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(360px, 520px) 1fr;
  gap: 20px;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid #e3e5e8;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.04);
}

label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-weight: 700;
  font-size: 13px;
}

input, select {
  min-height: 40px;
  border: 1px solid #ccd0d5;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

input[type="color"] {
  padding: 4px;
}

.check {
  grid-template-columns: 20px 1fr;
  align-items: center;
  font-weight: 400;
}

.check input {
  min-height: auto;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

button {
  border: 0;
  background: #333;
  color: #fff;
  border-radius: 8px;
  padding: 11px 18px;
  font-weight: 700;
  cursor: pointer;
}

button.publish {
  background: #ff6600;
}

pre {
  overflow: auto;
  background: #111827;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  min-height: 500px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .header { align-items: flex-start; flex-direction: column; }
}

.live-status {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #eef0f3;
  font-size: 13px;
}

.status-row span {
  color: #667;
}

.status-good {
  color: #198754;
}

.status-warning {
  color: #b56a00;
}

.live-status input[readonly] {
  background: #f8f9fb;
  color: #333;
  cursor: text;
}

.small-actions {
  flex-wrap: wrap;
}

.small-actions button {
  font-size: 12px;
  padding: 9px 12px;
}

.checkout-preview {
  --preview-primary-color: #ff6600;
  --preview-link-color: #ff6600;
  --preview-button-radius: 6px;

  border: 1px solid #e3e5e8;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 22px;
}

.preview-header {
  display: flex;
  padding: 18px;
  border-bottom: 1px solid #eef0f3;
  background: #fafafa;
}

.preview-header-left {
  justify-content: flex-start;
}

.preview-header-center {
  justify-content: center;
}

.preview-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--preview-primary-color);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 12px;
  aspect-ratio: 1 / 1;
}

.preview-logo-small {
  width: 76px;
  font-size: 13px;
}

.preview-logo-medium {
  width: 110px;
  font-size: 17px;
}

.preview-logo-large {
  width: 145px;
  font-size: 21px;
}

.preview-body {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  padding: 18px;
}

.preview-main {
  display: grid;
  gap: 12px;
}

.preview-express,
.preview-section,
.preview-summary {
  border: 1px solid #e7e9ed;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.preview-label {
  color: #667;
  font-size: 12px;
  margin-bottom: 8px;
  text-align: center;
}

.preview-wallets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preview-wallets button {
  background: #f4f5f7;
  color: #222;
  border: 1px solid #d8dce2;
  border-radius: var(--preview-button-radius);
  padding: 8px 6px;
  font-size: 12px;
}

.preview-section {
  display: grid;
  gap: 4px;
}

.preview-section span {
  color: #667;
  font-size: 12px;
}

.preview-place-order {
  border: 0;
  color: #fff;
  padding: 13px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--preview-primary-color);
  border-radius: var(--preview-button-radius);
}

.preview-summary {
  display: grid;
  gap: 10px;
  align-self: start;
  font-size: 13px;
}

.preview-total {
  font-weight: 800;
  font-size: 16px;
}

.advanced-preview summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .preview-body {
    grid-template-columns: 1fr;
  }

  .preview-summary {
    order: -1;
  }
}

.small-note {
  font-size: 12px;
  line-height: 1.4;
}

.config-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.config-compare h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.config-compare pre {
  min-height: 360px;
  max-height: 520px;
}

@media (max-width: 900px) {
  .config-compare {
    grid-template-columns: 1fr;
  }
}

.preview-summary-collapsed::after {
  content: "Mobile summary collapsed";
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #ccd0d5;
  color: #667;
  font-size: 12px;
}


.api-warning {
  background: #fff3cd;
  border: 1px solid #ffda6a;
  border-left: 5px solid #ff9900;
  border-radius: 8px;
  color: #4d3900;
  margin: 12px 0 22px;
  padding: 14px 16px;
}

.api-warning strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

.api-warning p {
  margin: 0 0 8px;
}

.api-warning ul {
  margin: 0;
  padding-left: 20px;
}

.api-warning li {
  margin: 3px 0;
}

.action-toast {
  background: #222;
  border-radius: 8px;
  bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  left: 50%;
  opacity: 0;
  padding: 12px 18px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 16px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 999999;
}

.action-toast--show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.action-toast--success {
  background: #16794c;
}

.action-toast--error {
  background: #b42318;
}

.action-toast--info {
  background: #222;
}

button.is-busy {
  cursor: wait;
  opacity: 0.75;
}

button.is-saved {
  background: #16794c !important;
  color: #fff !important;
}


.preview-logo.has-image-logo,
.visual-preview-logo.has-image-logo,
[data-preview-logo].has-image-logo,
#previewLogo.has-image-logo {
  align-items: center;
  background: transparent !important;
  border: 0;
  display: flex;
  justify-content: center;
  overflow: visible;
}

.preview-logo-img {
  display: block;
  height: auto;
  max-height: 82px;
  max-width: 160px;
  object-fit: contain;
  width: auto;
}



.logo-upload-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  margin-bottom: 8px;
}

.logo-upload-row input[type='file'] {
  margin-top: 6px;
}

.logo-upload-row button {
  margin-bottom: 0;
}

/* Real logo image sizing inside visual preview */
.preview-logo-small .preview-logo-img {
  max-height: 42px;
  max-width: 130px;
}

.preview-logo-medium .preview-logo-img {
  max-height: 62px;
  max-width: 170px;
}

.preview-logo-large .preview-logo-img {
  max-height: 82px;
  max-width: 220px;
}



.preview-order-summary-message {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid #ff6600;
  border-radius: 6px;
  box-sizing: border-box;
  color: #4a2a00;
  font-size: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.preview-order-summary-message strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.preview-order-summary-message span {
  display: block;
  line-height: 1.35;
  white-space: pre-wrap;
}

/* Keep optional message compact inside the visual Order Summary card */
#previewSummary .preview-order-summary-message {
  margin: 0 0 10px;
  min-height: 0;
  width: 100%;
}

#previewSummary .preview-order-summary-message span {
  white-space: pre-wrap;
}


.preview-order-summary-message ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.preview-order-summary-message li {
  line-height: 1.35;
  margin: 3px 0;
}

