:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --text: #18212b;
  --muted: #647386;
  --line: #dce3ea;
  --brand: #128c7e;
  --brand-strong: #075e54;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 10px 30px rgba(24, 33, 43, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.shell-narrow {
  max-width: 1040px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.brand p,
.hero p,
.field span,
.muted {
  color: var(--muted);
}

.brand p {
  margin: 2px 0 0;
  font-size: 14px;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.locale-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.locale-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.locale-button.is-active {
  border-color: #b9dcd5;
  background: #eaf8f4;
}

.nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(18, 140, 126, 0.35);
  outline-offset: 2px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}

.workspace-layout {
  position: relative;
  display: block;
}

.workspace-main {
  width: calc(100% - 380px);
  margin-bottom: 20px;
}

.analytics-panel { position: relative; min-height: 520px; overflow: hidden; }
.analytics-heading, .analytics-heading > div, .analytics-card-title { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.analytics-heading h2 { margin:0; font-size:22px; }
.analytics-heading p { margin:2px 0 0; color:var(--muted); }
.analytics-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:14px; background:#dcfce7; color:#08775a; font-size:23px; font-weight:900; }
.analytics-range-label { color:var(--muted); font-size:13px; }
.analytics-filters { display:flex; flex-wrap:wrap; gap:8px; margin:20px 0; }
.analytics-filters button { min-height:40px; padding:0 18px; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--text); font:600 14px inherit; cursor:pointer; }
.analytics-filters button.is-active { border-color:#16a97a; background:#eafbf4; color:#076a4d; }
.analytics-custom-range { display:flex; align-items:end; gap:10px; margin:-8px 0 18px; padding:12px; border-radius:10px; background:#f7faf9; }
.analytics-custom-range label { display:grid; gap:4px; color:var(--muted); font-size:12px; }
.analytics-custom-range input { min-height:40px; border:1px solid var(--line); border-radius:8px; padding:0 10px; font:inherit; }
.analytics-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.analytics-metrics article { padding:16px; border:1px solid var(--line); border-radius:11px; background:#fbfcfc; }
.analytics-metrics span { display:block; min-height:40px; color:var(--muted); font-size:13px; }
.analytics-metrics strong { display:block; font-size:30px; line-height:1; letter-spacing:-.04em; }
.analytics-details { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(220px,.8fr); gap:12px; margin-top:12px; }
.analytics-chart-card,.analytics-source-card { min-height:250px; padding:16px; border:1px solid var(--line); border-radius:11px; }
.analytics-card-title span { color:var(--muted); font-size:12px; }.analytics-card-title i { display:inline-block; width:8px; height:8px; border-radius:50%; background:#10b981; }
.analytics-chart { width:100%; margin-top:12px; }.analytics-chart svg { display:block; width:100%; height:205px; overflow:visible; }.analytics-chart text { fill:#788598; font:11px system-ui; }.chart-axis { stroke:#dce3ea; }.chart-line { fill:none; stroke:#10b981; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }.chart-dot { fill:#10b981; stroke:#fff; stroke-width:2; }
.analytics-source-card > strong { display:block; margin-bottom:22px; }.source-row { display:grid; grid-template-columns:1fr auto; gap:5px 12px; margin:18px 0; }.source-row div { height:8px; overflow:hidden; border-radius:99px; background:#edf1f3; }.source-row i { display:block; height:100%; border-radius:inherit; background:#10b981; }.source-row small { color:var(--muted); }
.analytics-empty,.analytics-loading { margin-top:12px; padding:14px; text-align:center; color:var(--muted); }.analytics-empty strong,.analytics-empty span { display:block; }.analytics-empty strong { color:var(--text); }
.analytics-lock { position:absolute; inset:0; z-index:4; display:grid; place-content:center; justify-items:center; padding:30px; text-align:center; background:rgba(255,255,255,.88); backdrop-filter:blur(5px); }.analytics-lock[hidden]{display:none}.analytics-lock > span { display:grid; place-items:center; width:58px; height:58px; border-radius:18px; background:#e8f8f1; font-size:27px; }.analytics-lock strong { margin-top:14px; font-size:19px; }.analytics-lock p { max-width:380px; margin:5px 0 0; color:var(--muted); }
.how-to-panel { padding:clamp(24px,5vw,50px); }.how-to-panel > h1 { max-width:760px; margin:8px 0; font-size:clamp(28px,4vw,42px); line-height:1.1; letter-spacing:-.035em; }.how-to-panel > .lead { max-width:780px; color:var(--muted); font-size:17px; }.how-to-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:30px; }.how-to-grid article { padding:20px; border:1px solid var(--line); border-radius:12px; background:#fbfcfc; }.how-to-grid b { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:#d8f3ed; color:var(--brand-strong); }.how-to-grid h2 { margin:15px 0 6px; font-size:18px; }.how-to-grid p,.how-to-note p { margin:0; color:var(--muted); }.how-to-note { margin-top:16px; padding:20px; border-left:4px solid var(--brand); border-radius:8px; background:#f0faf7; }

.workspace-status {
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
}

.settings-panel {
  width: calc(100% - 380px);
}

.settings-panel .field {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.setting-block {
  display: grid;
  align-content: start;
  gap: 6px;
}

.settings-panel .placement-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-panel .placement-options legend {
  grid-column: 1 / -1;
}

.settings-panel #saveButton {
  justify-self: start;
  min-width: 220px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.legal-panel {
  padding: clamp(24px, 5vw, 52px);
}

.legal-panel > .lead {
  max-width: 760px;
  margin: 8px 0 28px;
  color: var(--muted);
  font-size: 18px;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.legal-grid section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.legal-grid h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.legal-grid p {
  margin: 0;
  color: var(--muted);
}

.legal-grid a {
  color: var(--brand-strong);
  font-weight: 700;
}

.hero h2,
.panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: 0;
}

.hero p {
  margin: 0 0 22px;
  max-width: 760px;
}

.steps {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
}

.step b {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #d8f3ed;
  color: var(--brand-strong);
}

.step p {
  margin: 2px 0 0;
}

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input[type="file"] {
  padding: 10px;
  background: #fff;
}

.field span {
  font-size: 13px;
}

.placement-options {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.placement-options legend {
  margin-bottom: 8px;
  font-weight: 800;
}

.placement-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
}

.placement-option input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--brand);
}

.placement-option span,
.placement-option strong,
.placement-option small {
  display: block;
}

.placement-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.checkout-notice {
  margin: 0;
  padding: 12px;
  border: 1px solid #f5d58a;
  border-radius: 8px;
  background: #fffaeb;
  color: #7a4d00;
  font-size: 13px;
}

.status {
  border-radius: 8px;
  padding: 12px;
  background: #eef6ff;
  color: #1849a9;
}

.status.success {
  background: #ecfdf3;
  color: var(--success);
}

.status.error {
  background: #fef3f2;
  color: var(--danger);
}

.status[hidden] {
  display: none;
}

.support-toast[hidden] {
  display: none;
}

.support-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 10px;
  background: #18212b;
  color: #fff;
  box-shadow: 0 20px 40px rgba(24, 33, 43, 0.24);
}

.support-toast.success {
  background: var(--success);
}

.support-toast.error {
  background: var(--danger);
}

.connection-card {
  display: grid;
  gap: 8px;
  margin: 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 16px;
}

.platform-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f1f5f4;
}

.platform-switcher button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.platform-switcher button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(20, 36, 31, 0.12);
}

.connection-card strong {
  font-size: 16px;
}

.connection-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.connection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.connection-card .button {
  margin-top: 10px;
  justify-self: start;
}

.connection-actions .button {
  margin-top: 0;
}

.button-secondary {
  border-color: #c9d8d2;
  background: #fff;
  color: var(--ink);
}

.connection-card .button[hidden] {
  display: none;
}

.billing-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 6px;
}

.billing-actions .button {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
}

.billing-actions .button[disabled] {
  cursor: not-allowed;
  opacity: .6;
}

.billing-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid #cfe5df;
  border-radius: 8px;
  background: #f5fbf9;
}

.billing-price-label,
.billing-methods-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.billing-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.billing-amount {
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}

.billing-period {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.billing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #d8f3ed;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.billing-methods-inline {
  display: grid;
  gap: 8px;
}

.billing-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}

.billing-methods {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.billing-method {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.billing-method-primary {
  border-color: #cfe5df;
  background: #f9fdfc;
}

.billing-method p {
  margin-top: 4px;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #d8f3ed;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.method-badge-muted {
  background: #edf2f7;
  color: #475467;
}

.pix-panel {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pix-panel p {
  margin: 0;
}

.pix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.billing-footnote {
  margin: 2px 0 0;
  font-size: 13px;
}

.billing-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.coupon-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.coupon-actions {
  display: flex;
  gap: 10px;
}

.coupon-actions .button {
  width: 100%;
}

.subscription-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
}

.subscription-main,
.subscription-side {
  align-self: start;
}

.subscription-main {
  display: grid;
  gap: 18px;
}

.subscription-side {
  display: grid;
  gap: 16px;
}

.subscription-price-card,
.subscription-method-summary,
.subscription-checkout-card,
.subscription-manual-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  padding: 18px;
}

.subscription-price-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-color: #cfe5df;
  background: #f5fbf9;
}

.subscription-checkout-card .billing-actions,
.subscription-manual-card .billing-actions {
  margin-top: 0;
}

.modal-shell[hidden] {
  display: none;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(480px, calc(100vw - 32px));
  margin: 10vh auto 0;
  padding: 24px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  border: 1px solid var(--line);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-card h2 {
  margin: 10px 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
}

.modal-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 22px;
}

.modal-price strong {
  font-size: 36px;
  line-height: 1;
}

.modal-price span {
  color: var(--muted);
  font-weight: 600;
}

.modal-actions {
  display: grid;
  gap: 10px;
}

.modal-actions .button {
  width: 100%;
  min-height: 48px;
}

.eyebrow {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.manual-details {
  border-radius: 8px;
}

.manual-details summary {
  cursor: pointer;
  font-weight: 700;
}

.manual-details .form {
  margin-top: 16px;
}

.install-form {
  margin-bottom: 16px;
}

.docs-panel h1 {
  margin-top: 0;
}

.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}

.support-form h1 {
  margin: 10px 0 8px;
}

.support-actions {
  display: flex;
  justify-content: flex-start;
}

.support-actions .button {
  min-width: 180px;
}

.support-side {
  align-self: start;
}

.support-side h2 {
  margin-top: 0;
}

.docs-panel h2 {
  margin-top: 24px;
}

.check-list {
  display: grid;
  gap: 8px;
  padding-left: 22px;
}

.check-list li {
  color: var(--muted);
}

.check-list strong {
  color: var(--text);
}

.code {
  display: block;
  overflow-x: auto;
  border-radius: 8px;
  background: #17202a;
  color: #e8eef5;
  padding: 14px;
  font-size: 13px;
}

@media (max-width: 860px) {
  .topbar,
  .nav {
    align-items: stretch;
    flex-direction: column;
  }

  .locale-switcher {
    justify-content: center;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .workspace-main,
  .workspace-status,
  .settings-panel {
    position: static;
    width: 100%;
  }

  .workspace-status { order: 1; }
  .workspace-main { order: 2; }
  .settings-panel { order: 3; }

  .settings-panel .field,
  .settings-panel .placement-options {
    grid-template-columns: 1fr;
  }

  .settings-panel .placement-options legend {
    grid-column: auto;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }

  .subscription-layout {
    grid-template-columns: 1fr;
  }

  .support-layout {
    grid-template-columns: 1fr;
  }

  .billing-summary {
    flex-direction: column;
  }

  .billing-compact,
  .subscription-price-card {
    flex-direction: column;
    align-items: stretch;
  }

  .billing-amount {
    font-size: 28px;
  }

  .modal-card {
    margin-top: 8vh;
    padding: 20px;
  }

  .support-toast {
    right: 16px;
    left: 16px;
    bottom: 16px;
    max-width: none;
  }

  .modal-card h2 {
    font-size: 24px;
  }
}
:root #ctaSettings {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
}

:root #cartButtonSettings {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#cartButtonSettings input,
#cartButtonSettings select {
  width: 100%;
  box-sizing: border-box;
  margin: 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.color-field { display: grid; gap: 4px; }

.color-control {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

#cartButtonSettings .color-control > .color-hex { margin-bottom: 10px; }
#cartButtonSettings .color-hex { min-width: 0; font-family: "SFMono-Regular", Consolas, monospace; text-transform: uppercase; }
.color-trigger {
  width: 52px;
  height: 46px;
  margin-bottom: 10px;
  border: 1px solid #cddbd5;
  border-radius: 10px;
  background: #16a34a;
  box-shadow: inset 0 0 0 4px #fff;
  cursor: pointer;
}
.color-trigger:focus-visible { outline: 3px solid rgba(8, 127, 111, 0.22); outline-offset: 2px; }
.color-picker {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(20, 35, 31, 0.14);
}
.color-picker[hidden] { display: none; }
.color-spectrum {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.7;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(var(--picker-hue, 134) 100% 50%));
  cursor: crosshair;
  touch-action: none;
}
.color-cursor {
  position: absolute;
  left: calc(var(--picker-saturation, 86) * 1%);
  top: calc((100 - var(--picker-value, 64)) * 1%);
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 2px 5px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
#cartButtonSettings .color-hue {
  width: 100%;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  appearance: none;
  cursor: pointer;
}
.color-hue::-webkit-slider-thumb { width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); appearance: none; }
.color-hue::-moz-range-thumb { width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }

.button-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.button-preview {
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #d8e4df;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fbfa, #eef5f2);
}
.button-preview-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.button-preview-heading div { display: grid; gap: 2px; }
.button-preview-heading span { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.button-preview-heading strong { color: var(--text); font-size: 16px; }
.button-preview-heading small { max-width: 280px; color: var(--muted); line-height: 1.45; text-align: right; }
.button-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.preview-card { display: grid; align-content: end; min-height: 166px; padding: 14px; border: 1px solid #dbe5e1; border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(20, 35, 31, 0.05); }
.preview-card-label { align-self: start; margin-bottom: auto; color: #73817c; font-size: 11px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.preview-product-copy { display: flex; gap: 10px; margin: 15px 0 12px; }
.preview-product-copy i { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg, #dce9e4, #f1f6f4); }
.preview-product-copy span { display: grid; flex: 1; align-content: center; gap: 7px; }
.preview-product-copy b, .preview-product-copy small, .preview-checkout-placeholder { display: block; border-radius: 999px; background: #e8efec; }
.preview-product-copy b { width: 72%; height: 8px; }
.preview-product-copy small { width: 42%; height: 7px; }
.preview-cart-total { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 12px; padding-top: 12px; border-top: 1px solid #e6ece9; color: var(--text); }
.preview-cart-total span { font-size: 13px; }
.preview-cart-total strong { font-size: 17px; }
.cta-button-preview { width: 100%; min-height: 44px; padding: 10px 14px; border: 2px solid transparent; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 750; line-height: 1.2; cursor: default; pointer-events: none; transition: color 120ms ease, background 120ms ease, border-color 120ms ease, border-radius 120ms ease; }
.preview-checkout-placeholder { width: 100%; height: 9px; margin-top: 12px; }

@media (max-width: 620px) {
  .button-style-grid { grid-template-columns: 1fr; }
  .button-preview-heading { display: grid; }
  .button-preview-heading small { text-align: left; }
  .button-preview-grid { grid-template-columns: 1fr; }
}
#ctaSettings input { width: 100%; box-sizing: border-box; margin-bottom: 10px; }
#ctaPreview { display: block; overflow-wrap: anywhere; color: #087f72; }

/* Modern product workspace */
:root {
  --bg: #f3f6f4;
  --surface-soft: #f7faf8;
  --text: #14231f;
  --muted: #64736e;
  --line: #dce6e1;
  --brand: #087f6f;
  --brand-strong: #045e53;
  --brand-soft: #dff5ee;
  --shadow: 0 18px 50px rgba(20, 35, 31, 0.07);
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 8% 0%, rgba(8, 127, 111, 0.09), transparent 28rem), linear-gradient(180deg, #f8faf9 0, var(--bg) 34rem);
  font-family: "Avenir Next", "Segoe UI Variable", "Nunito Sans", sans-serif;
}

.shell { max-width: 1440px; padding: 26px clamp(18px, 3.2vw, 52px) 64px; }
.topbar {
  min-height: 72px;
  margin-bottom: 24px;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(220, 230, 225, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 32px rgba(20, 35, 31, 0.05);
  backdrop-filter: blur(14px);
}

.brand img { width: 48px; height: 48px; padding: 6px; border-radius: 14px; background: var(--brand-soft); }
.brand h1 { font-size: clamp(19px, 2vw, 25px); font-weight: 800; letter-spacing: -0.035em; }
.nav a, .button { min-height: 44px; border-radius: 11px; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.nav a:hover, .button:hover:not(:disabled) { transform: translateY(-1px); border-color: #b6cbc2; box-shadow: 0 8px 20px rgba(20, 35, 31, 0.08); }
.button.primary { border-color: var(--brand); background: var(--brand); box-shadow: 0 10px 24px rgba(8, 127, 111, 0.2); }

.workspace-layout { display: block; position: relative; }

/* Dashboard and personalization share the same connected-store state, but
   each route exposes only the workspace relevant to that task. */
body[data-page="home"][data-view="dashboard"] .settings-panel { display: none; }
body[data-page="home"][data-view="personalize"] .analytics-panel { display: none; }
body[data-page="home"][data-view="personalize"] .workspace-status { position: static; width: 100%; margin: 0 0 22px; }
.workspace-main { width: calc(100% - 372px); margin: 0 0 22px; }
.settings-panel { width: 100%; margin: 0 0 22px; }
.workspace-status { position: absolute; top: 0; right: 0; width: 350px; margin: 0; }

.panel { border-color: rgba(210, 224, 217, 0.95); border-radius: 18px; padding: clamp(22px, 3vw, 34px); box-shadow: var(--shadow); }
.hero { overflow: hidden; background: radial-gradient(circle at 92% 10%, rgba(8, 127, 111, 0.14), transparent 17rem), var(--surface); }
.hero h2, .panel h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.12; letter-spacing: -0.035em; }
.hero > p { max-width: 820px; font-size: 16px; }
.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 28px 0 20px; }
.step { display: block; min-height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.76); }
.step b { margin-bottom: 14px; background: var(--brand-soft); }

.workspace-status.panel { padding: 18px; }
.status { margin: 0 0 12px; border: 1px solid #cfe0f3; border-radius: 12px; font-weight: 650; }
.connection-card { margin: 0 0 12px; padding: 16px; border-radius: 14px; background: var(--surface-soft); }
.settings-panel > h2 { margin-bottom: 18px; }
.settings-panel .form { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.settings-panel .form > .field:first-of-type { grid-column: span 3; grid-template-columns: minmax(0, 1fr); align-self: start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.settings-panel .form > .field:nth-of-type(2) { grid-column: span 9; grid-template-columns: repeat(2, minmax(300px, 1fr)); gap: 14px; }
.settings-panel .message-setting { grid-column: 1 / -1; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }

:root #ctaSettings, :root #cartButtonSettings { margin: 0; padding: 16px; border-color: var(--line); border-radius: 14px; background: var(--surface-soft); }
fieldset legend { padding: 0 8px; color: var(--text); font-weight: 800; }
.field input, .field textarea, #cartButtonSettings input, #cartButtonSettings select { min-height: 46px; border-color: #cddbd5; border-radius: 10px; background: #fff; transition: border-color 150ms ease, box-shadow 150ms ease; }
.field input:focus, .field textarea:focus, #cartButtonSettings input:focus, #cartButtonSettings select:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 4px rgba(8, 127, 111, 0.11); }
.message-setting textarea {
  width: 100%;
  min-height: 104px;
  padding: 12px;
  border: 1px solid #cddbd5;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}
.message-setting textarea:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 4px rgba(8, 127, 111, 0.11); }

.settings-panel .placement-options { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.placement-option { padding: 16px; border-radius: 12px; background: #fff; }
.placement-option:has(input:checked) { border-color: #78bdad; background: #f2fbf8; box-shadow: inset 0 0 0 1px #78bdad; }
.checkout-notice { grid-column: 1 / -1; padding: 15px 17px; border-radius: 12px; }
.settings-panel #saveButton { grid-column: 1 / -1; justify-self: end; min-width: 240px; min-height: 50px; }

@media (prefers-reduced-motion: no-preference) {
  .workspace-main, .workspace-status, .settings-panel { animation: panel-in 420ms ease both; }
  .workspace-status { animation-delay: 70ms; }
  .settings-panel { animation-delay: 120ms; }
}
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1080px) {
  .workspace-main, .workspace-status, .settings-panel { position: static; width: 100%; }
  .workspace-status { margin-bottom: 22px; }
  .steps { grid-template-columns: 1fr; }
  .step { min-height: auto; }
}

@media (max-width: 760px) {
  .shell { padding: 14px 12px 40px; }
  .topbar { align-items: stretch; padding: 14px; }
  .nav { flex-direction: row; align-items: center; }
  .nav a { flex: 1; }
  .settings-panel .form > .field:first-of-type, .settings-panel .form > .field:nth-of-type(2), .settings-panel .placement-options { grid-column: 1 / -1; }
  .settings-panel .form > .field:nth-of-type(2), .settings-panel .placement-options, .button-style-grid { grid-template-columns: 1fr; }
  .settings-panel #saveButton { width: 100%; min-width: 0; }
  .panel { padding: 20px; border-radius: 15px; }
}

/* Configuration studio */
.settings-panel { width: 100%; }
.settings-panel > h2 { margin-bottom: 20px; }
.settings-panel .form { display: block; }
.configuration-workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr); gap: 20px; align-items: start; }
.settings-controls { display: grid; min-width: 0; gap: 14px; }
.settings-controls > .field, .settings-controls > .setting-block, .settings-controls > .placement-options, .settings-controls > .checkout-notice, .settings-controls > #saveButton { grid-column: auto !important; width: 100%; }
.settings-controls > .field:first-child { display: block; padding: 0; border: 0; background: transparent; }
.settings-controls > .field:nth-child(2) { display: grid; grid-template-columns: 1fr; gap: 14px; }
.settings-controls .setting-block, :root .settings-controls #ctaSettings, :root .settings-controls #cartButtonSettings, .settings-controls .placement-options { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfc; }
.settings-controls .placement-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.settings-controls #saveButton { justify-self: stretch; min-height: 52px; }
.preview-studio { position: sticky; top: 18px; min-width: 0; }
.preview-studio .button-preview { margin: 0; padding: 18px; border-radius: 16px; background: linear-gradient(155deg, #ffffff 0%, #f1f7f4 100%); box-shadow: 0 18px 45px rgba(20, 35, 31, 0.09); }
.preview-mode-switch { display: flex; justify-content: flex-end; gap: 4px; margin: -4px 0 14px; padding: 4px; border-radius: 10px; background: #eaf1ee; }
.preview-mode-switch button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 7px; color: #52625d; background: transparent; font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; }
.preview-mode-switch button.is-active { color: #067647; background: #fff; box-shadow: 0 3px 10px rgba(20, 35, 31, 0.1); }
.preview-studio .button-preview-grid { grid-template-columns: 1fr; }
.preview-studio .preview-card { min-height: 0; padding: 0; overflow: hidden; border-radius: 13px; }
.preview-studio .preview-card-label { padding: 13px 15px 10px; color: #33443e; font-size: 12px; }
.preview-browser-bar { display: flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 12px; border-top: 1px solid #e4ebe8; border-bottom: 1px solid #e4ebe8; background: #f5f8f7; }
.preview-browser-bar i { width: 8px; height: 8px; border-radius: 50%; background: #ff725e; }
.preview-browser-bar i:nth-child(2) { background: #ffb224; }
.preview-browser-bar i:nth-child(3) { background: #14b866; }
.preview-browser-bar b { margin-left: 8px; color: #31423c; font-size: 10px; letter-spacing: 0.05em; }
.preview-product-body { display: grid; grid-template-columns: minmax(130px, 0.9fr) minmax(160px, 1.1fr); gap: 16px; padding: 16px; }
.preview-product-visual { display: grid; min-height: 158px; place-items: center; border-radius: 10px; background: radial-gradient(circle at 45% 38%, #fff, #e7eeeb); }
.preview-product-visual span { font-size: 70px; filter: grayscale(0.15); transform: rotate(-8deg); }
.preview-product-details { display: flex; flex-direction: column; align-items: stretch; justify-content: center; min-width: 0; color: #17251f; }
.preview-product-details > strong { font-size: 14px; }
.preview-product-details > b { margin: 5px 0 12px; font-size: 18px; }
.preview-lines { display: grid; gap: 6px; margin-bottom: 18px; }
.preview-lines i { width: 100%; height: 7px; border-radius: 99px; background: #e3e9e6; }
.preview-lines i:nth-child(2) { width: 82%; }
.preview-lines i:nth-child(3) { width: 58%; }
.preview-product-actions { display: flex; flex-direction: column; gap: 10px; }
.preview-studio .preview-product-actions .cta-button-preview { width: 100%; margin: 0; }
.preview-native-buy { width: 100%; min-height: 42px; padding: 10px 14px; border: 1px solid #31423c; border-radius: 8px; background: #31423c; color: #fff; font: inherit; font-weight: 600; pointer-events: none; }
.preview-cart-item { display: grid; grid-template-columns: 44px 1fr 28px; gap: 10px; align-items: center; margin: 0 14px; padding: 10px 0; border-bottom: 1px solid #e8eeeb; }
.preview-cart-item > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 8px; background: #eff4f2; font-size: 25px; }
.preview-cart-item div { display: grid; min-width: 0; gap: 2px; }
.preview-cart-item strong { overflow: hidden; color: #24342e; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.preview-cart-item small { color: #687873; font-size: 11px; }
.preview-cart-item > b { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid #dbe4e0; border-radius: 6px; font-size: 11px; }
.preview-studio .preview-cart-total { margin: 12px 14px; }
.preview-studio .cta-button-preview { width: calc(100% - 28px); margin: 0 14px 14px; }
.preview-cart-actions { display: flex; flex-direction: column; gap: 10px; margin: 0 14px 14px; }
.preview-studio .preview-cart-actions .cta-button-preview { width: 100%; margin: 0; }
.preview-cart-note { color: #687873; font-size: 11px; text-align: center; }
.button-preview-grid.is-mobile { max-width: 340px; margin-inline: auto; }
.button-preview-grid.is-mobile .preview-product-body { grid-template-columns: 1fr; }
.button-preview-grid.is-mobile .preview-product-visual { min-height: 125px; }

@media (max-width: 1100px) {
  .configuration-workspace { grid-template-columns: 1fr; }
  .preview-studio { position: static; }
}

@media (max-width: 620px) {
  .settings-controls .placement-options { grid-template-columns: 1fr; }
  .preview-mode-switch { justify-content: stretch; }
  .preview-mode-switch button { flex: 1; }
  .preview-product-body { grid-template-columns: 1fr; }
  .analytics-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .analytics-details { grid-template-columns: 1fr; }
  .analytics-heading { align-items:flex-start; }
  .analytics-heading > div { align-items:flex-start; }
  .analytics-range-label { display:none; }
  .analytics-custom-range { align-items:stretch; flex-direction:column; }
  .how-to-grid { grid-template-columns:1fr; }
}

/* Quotation controls follow the same accessible sizing as button settings. */
#quotationSettings select { display: block; width: 100%; max-width: 100%; min-height: 46px; margin: 8px 0 16px; padding: 10px 12px; border: 1px solid #cddbd5; border-radius: 10px; background: #fff; color: var(--text); font: inherit; }
#quotationSettings select:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 4px rgba(8,127,111,.11); }
