* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1e1e1e;
  color: #e0e0e0;
  font-size: 13px;
  line-height: 1.5;
}

#app { padding: 16px; }

header { margin-bottom: 16px; border-bottom: 1px solid #333; padding-bottom: 12px; }
header h1 { font-size: 16px; font-weight: 700; color: #fff; }

.subtle { color: #888; font-size: 11px; margin-top: 2px; }

section { margin-bottom: 20px; }
section h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aaa;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  background: #333;
  color: #ccc;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}

.info-box {
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: #ccc;
  word-break: break-all;
}

.status-ok { border-color: #2d6a4f; background: #1a3a2a; color: #6fcf97; }
.status-warn { border-color: #92400e; background: #3a2a1a; color: #f6ad55; }
.status-error { border-color: #991b1b; background: #3a1a1a; color: #fc8181; }

.actions { display: flex; gap: 6px; margin-top: 8px; }

.btn {
  padding: 6px 12px;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  flex: 1;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: #0073e6; color: #fff; }
.btn-secondary { background: #333; color: #ccc; border: 1px solid #444; }
.btn-danger { background: #991b1b; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

.form-group { margin-bottom: 10px; }
.form-group label {
  display: block;
  font-size: 11px;
  color: #aaa;
  margin-bottom: 3px;
  font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 6px 8px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 12px;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: #0073e6;
}
.form-group input[type="password"] { letter-spacing: 0.15em; }
.form-group .hint {
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #2a2a2a;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row label { font-size: 12px; color: #ccc; }

.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #444;
  border-radius: 20px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: #ccc;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: #0073e6; }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); background: #fff; }

.divider {
  height: 1px;
  background: #333;
  margin: 16px 0;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 10px;
  margin-bottom: 4px;
}
.copy-row span { flex: 1; font-size: 12px; color: #ccc; }
.copy-row .btn { flex: 0; }

.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid #333;
}
.tab-bar button {
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: none;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.tab-bar button:hover { color: #ccc; }
.tab-bar button.active { color: #fff; border-bottom-color: #0073e6; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Shopify Everywhere embed generator (recycled from story-tiptap) ── */
.se-funnels { display: flex; gap: 6px; margin-bottom: 4px; }
.se-funnel {
  flex: 1; padding: 7px 10px; font-size: 12px; font-weight: 600;
  background: #2a2a2a; color: #aaa; border: 1px solid #333; border-radius: 6px;
  cursor: pointer; transition: all .12s;
}
.se-funnel:hover { color: #ccc; }
.se-funnel.active { background: #0a2a4a; color: #4ea1f0; border-color: #0073e6; }

.se-tabs { display: flex; gap: 2px; margin: 8px 0 0; border-bottom: 1px solid #333; }
.se-tab {
  padding: 6px 12px; font-size: 11px; font-weight: 600;
  background: none; color: #888; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; transition: color .12s;
}
.se-tab:hover { color: #ccc; }
.se-tab.active { color: #4ea1f0; border-bottom-color: #0073e6; }

.se-code-wrap { position: relative; margin-top: 8px; }
.se-code {
  background: #161616; border: 1px solid #333; border-radius: 6px;
  padding: 10px 12px; margin: 0; font-family: 'SF Mono','Consolas',monospace;
  font-size: 10px; line-height: 1.5; color: #c8d3de; white-space: pre-wrap;
  word-break: break-all; max-height: 220px; overflow-y: auto;
}
.se-copy { position: absolute; top: 6px; right: 6px; }

/* ── In-Designer onboarding wizard ── */
#onboarding { display: none; border: 1px solid #333; border-radius: 10px; padding: 16px; margin-bottom: 16px; background: #242424; }
#app.onboarding-active #onboarding { display: block; }
#app.onboarding-active .tab-bar,
#app.onboarding-active .tab-panel { display: none !important; }
.ob-step { display: none; }
.ob-step.active { display: block; }
.ob-h { font-size: 14px; font-weight: 600; color: #fff; text-transform: none; letter-spacing: 0; margin-bottom: 6px; }
.ob-step .subtle { font-size: 12px; line-height: 1.55; margin-bottom: 10px; }
.ob-dots { display: flex; gap: 6px; margin-bottom: 12px; }
.ob-dots i { width: 7px; height: 7px; border-radius: 50%; background: #444; display: inline-block; transition: background .15s; }
.ob-dots i.on { background: #0073e6; }
.ob-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; }
.ob-right { display: flex; gap: 8px; }
.ob-links { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.btn-link { background: none; border: none; color: #888; font-size: 11px; cursor: pointer; margin-top: 12px; text-decoration: underline; padding: 0; }
.btn-link:hover { color: #ccc; }
