/* ============================================================
   The Tech Pad — first-run onboarding wizard styles
   ------------------------------------------------------------
   Shows for a brand-new workspace (0 WhatsApp numbers, no chat
   widget yet). Takes over the overview card area while active
   (body.onb-active hides every other .dashboard child), guiding
   the user through channel choice and setup steps.

   Light theme only: cards #fff, borders #dfe6e2, text #14231e,
   accent #128c7e (readable on white), fills #f1f5f3/#fafcfb.
   All classes scoped .onb-* to avoid collisions.
   ============================================================ */

body.onb-active .dashboard > * {
  display: none !important;
}
body.onb-active .dashboard > #onb-root {
  display: block !important;
}

#onb-root.onb-card {
  align-self: center;
  width: 100%;
  max-width: 860px;
  margin: 8px auto 28px;
  background: #fff;
  border: 1px solid #dfe6e2;
  border-radius: 16px;
  box-shadow: 0 10px 34px rgba(20, 35, 30, .08);
  padding: 26px 28px 22px;
  color: #14231e;
  font-size: 14.5px;
  line-height: 1.5;
  box-sizing: border-box;
}

/* ---------- header ---------- */
.onb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.onb-head .onb-logo {
  font-size: 22px; line-height: 1;
  background: #0d2b22; color: #7fe0cd;
  border-radius: 12px; padding: 10px 12px;
}
.onb-kicker {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: #128c7e; margin: 2px 0 4px;
}
.onb-card h1.onb-title { margin: 0 0 4px; font-size: 23px; color: #14231e; }
.onb-card h2.onb-sub { margin: 0 0 10px; font-size: 19px; color: #14231e; }
.onb-lead { margin: 0 0 18px; color: #74827c; font-size: 14.5px; max-width: 620px; }
.onb-close {
  flex: 0 0 auto;
  background: #f1f5f3; color: #74827c;
  border: 1px solid #dfe6e2; border-radius: 9px;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 12px; cursor: pointer;
}
.onb-close:hover { background: #e4ece8; color: #14231e; }

/* ---------- progress ---------- */
.onb-progress { display: flex; align-items: center; gap: 8px; margin: 14px 0 18px; }
.onb-progress .onb-step {
  font-size: 11.5px; font-weight: 600; color: #74827c;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.onb-progress .onb-step .onb-dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e4ece8; color: #74827c; font-size: 11px; font-weight: 700;
  flex: 0 0 auto;
}
.onb-progress .onb-step.done .onb-dot { background: #128c7e; color: #fff; }
.onb-progress .onb-step.active { color: #14231e; }
.onb-progress .onb-step.active .onb-dot { background: #0d2b22; color: #fff; }
.onb-progress .onb-bar { flex: 1; height: 3px; background: #e4ece8; border-radius: 2px; min-width: 14px; }
.onb-progress .onb-bar.filled { background: #128c7e; }

/* ---------- channel choice ---------- */
.onb-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 4px 0 18px; }
.onb-opt-both { border-color: #a9d8c9; background: linear-gradient(180deg, #f2faf6, #fafcfb); }
.onb-opt-both .onb-opt-go { color: #0b6e5f; }
.onb-opt-both .onb-free { background: #ffefc2; color: #8a6410; }
.onb-opt {
  position: relative;
  border: 1.5px solid #dfe6e2; border-radius: 14px;
  background: #fafcfb; padding: 20px 18px;
  text-align: left; cursor: pointer; font: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex; flex-direction: column; gap: 8px;
}
.onb-opt:hover { border-color: #128c7e; box-shadow: 0 4px 16px rgba(18, 140, 126, .12); transform: translateY(-1px); }
.onb-opt:focus-visible { outline: 2px solid #128c7e; outline-offset: 2px; }
.onb-opt .onb-opt-icon { font-size: 26px; line-height: 1; }
.onb-opt .onb-opt-title { font-size: 16.5px; font-weight: 700; color: #14231e; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.onb-opt .onb-opt-desc { font-size: 13.5px; color: #74827c; margin: 0; }
.onb-free {
  background: #e6f6f2; color: #0b6e5f;
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  border-radius: 999px; padding: 2px 9px; text-transform: uppercase;
}
.onb-opt .onb-opt-go { margin-top: 4px; font-size: 13px; font-weight: 700; color: #128c7e; }

/* ---------- forms ---------- */
.onb-field { margin: 0 0 16px; }
.onb-field label.onb-label { display: block; font-size: 13px; font-weight: 700; color: #14231e; margin-bottom: 6px; }
.onb-field .onb-hint { font-size: 12.5px; color: #74827c; margin: 6px 0 0; }
.onb-input, .onb-textarea, .onb-select {
  width: 100%; box-sizing: border-box;
  border: 1px solid #c3d2cb; border-radius: 10px;
  background: #fff; color: #14231e;
  font: inherit; font-size: 14.5px; padding: 10px 12px;
}
.onb-input:focus, .onb-textarea:focus, .onb-select:focus {
  outline: none; border-color: #128c7e; box-shadow: 0 0 0 3px rgba(18, 140, 126, .15);
}
.onb-input.err { border-color: #d64545; box-shadow: 0 0 0 3px rgba(214, 69, 69, .12); }
.onb-textarea { min-height: 74px; resize: vertical; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.onb-textarea.onb-snippet { min-height: 60px; background: #f6f9f8; }

/* AI mode radios */
.onb-radios { display: grid; gap: 10px; margin: 2px 0 6px; }
.onb-radio {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1.5px solid #dfe6e2; border-radius: 12px;
  padding: 14px 16px; cursor: pointer; background: #fafcfb;
  transition: border-color .15s, background .15s;
}
.onb-radio:hover { border-color: #128c7e; }
.onb-radio.sel { border-color: #128c7e; background: #f0faf7; box-shadow: 0 0 0 3px rgba(18, 140, 126, .12); }
.onb-radio input { margin-top: 3px; accent-color: #128c7e; width: 15px; height: 15px; flex: 0 0 auto; }
.onb-radio .onb-r-title { font-weight: 700; color: #14231e; font-size: 14.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.onb-radio .onb-r-desc { font-size: 13px; color: #74827c; margin: 3px 0 0; }

/* KB source pills */
.onb-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.onb-pill {
  border: 1.5px solid #dfe6e2; background: #fafcfb; color: #14231e;
  border-radius: 999px; padding: 7px 15px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.onb-pill:hover { border-color: #128c7e; }
.onb-pill.sel { background: #0d2b22; border-color: #0d2b22; color: #fff; }
.onb-panel { border: 1px solid #dfe6e2; background: #fafcfb; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }

.onb-faq-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin-bottom: 8px; align-items: start; }
.onb-faq-row input { border: 1px solid #c3d2cb; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px; background: #fff; color: #14231e; }
.onb-faq-row input:focus { outline: none; border-color: #128c7e; }
.onb-faq-del {
  border: 1px solid #dfe6e2; background: #fff; color: #a05c5c;
  border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 13px; font-weight: 700;
}
.onb-faq-del:hover { background: #fdf1f1; border-color: #d64545; }
.onb-linkbtn {
  background: none; border: none; padding: 0; margin: 0;
  color: #128c7e; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.onb-linkbtn:hover { text-decoration: underline; }
.onb-linkbtn.ghost { color: #74827c; font-weight: 600; }

.onb-status { font-size: 13px; margin: 10px 0 0; display: flex; align-items: center; gap: 8px; }
.onb-status.ok { color: #0b6e5f; }
.onb-status.err { color: #c03a3a; }
.onb-status .onb-spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #cfe3dc; border-top-color: #128c7e;
  animation: onb-spin .7s linear infinite; display: inline-block; flex: 0 0 auto;
}
@keyframes onb-spin { to { transform: rotate(360deg); } }

/* ---------- actions ---------- */
.onb-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.onb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; padding: 10px 20px;
  font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; text-decoration: none;
}
.onb-btn.primary { background: #128c7e; color: #fff; }
.onb-btn.primary:hover { background: #17a08f; }
.onb-btn.primary:disabled { background: #a8c8c0; cursor: not-allowed; }
.onb-btn.ghost { background: #fff; color: #2f443d; border-color: #c3d2cb; }
.onb-btn.ghost:hover { background: #f1f5f3; }
.onb-btn.dark { background: #0d2b22; color: #fff; }
.onb-btn.dark:hover { background: #14503f; }
.onb-btn.busy { opacity: .75; pointer-events: none; }
.onb-actions .onb-spacer { flex: 1; }
.onb-actions .onb-skip {
  background: none; border: none; color: #74827c; font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 4px; text-decoration: underline;
}
.onb-actions .onb-skip:hover { color: #14231e; }

/* ---------- install / success ---------- */
.onb-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .05em; color: #0b6e5f; background: #e6f6f2; border-radius: 999px; padding: 4px 11px; }
.onb-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #17b392; box-shadow: 0 0 0 3px rgba(23, 179, 146, .2); }
.onb-copied { color: #0b6e5f; font-weight: 700; font-size: 13px; }
.onb-bigcheck { font-size: 44px; line-height: 1; text-align: center; margin-bottom: 6px; }
.onb-note-box {
  background: #f1f5f3; border: 1px solid #dfe6e2; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: #2f443d; margin: 12px 0 0;
}
.onb-note-box a { color: #128c7e; font-weight: 700; }
.onb-divider { height: 1px; background: #dfe6e2; margin: 16px 0; }

/* ---------- toast ---------- */
.onb-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: #0d2b22; color: #eafff6; padding: 11px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; z-index: 99999; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; box-shadow: 0 8px 26px rgba(13, 43, 34, .35);
}
.onb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.onb-toast.err { background: #8f2d2d; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  #onb-root.onb-card { margin: 4px 0 20px; padding: 18px 16px; border-radius: 12px; }
  .onb-options { grid-template-columns: 1fr; }
  .onb-faq-row { grid-template-columns: 1fr; }
  .onb-progress .onb-step span.onb-step-label { display: none; }
  .onb-actions .onb-btn { flex: 1; }
}

/* ---- multi-channel choice (2026-09-09): 2x2 pick tiles ---- */
.onb-options.onb-cols2 { grid-template-columns: repeat(2, 1fr); }
.onb-opt.onb-pick { cursor: pointer; text-align: left; }
.onb-opt.onb-pick .onb-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #c3d2cb;
  background: #fff;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  transition: all .12s;
}
.onb-opt.onb-pick.sel {
  border-color: #128c7e;
  background: linear-gradient(180deg, #f2faf6, #fafcfb);
  box-shadow: 0 4px 16px rgba(18, 140, 126, .14);
}
.onb-opt.onb-pick.sel .onb-check { background: #128c7e; border-color: #128c7e; }
.onb-opt.onb-pick .onb-opt-go { display: none; }
@media (max-width: 640px) {
  .onb-options.onb-cols2 { grid-template-columns: 1fr; }
}
