/* Bright light-mode contextual conversion & interception UI
 * CSP style-src 'self' compliant (zero inline styles, zero dark teal/gray-beige).
 * Covers:
 * 1) Over-limit interception modal & inline rescue card (.ysx-ol-*)
 * 2) Result-page downstream workflow & script-pack handoff (.ysx-ns-*)
 */

.ysx-ol-backdrop[hidden],
.ysx-ol-inline[hidden],
.ysx-ol-drawer[hidden],
.ysx-ns-card[hidden],
.ysx-ns-drawer[hidden],
.ysx-lead-ok[hidden],
.ysx-trap[hidden] {
  display: none !important;
}

.ysx-trap {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---------- 1. Over-Limit Modal & Inline Rescue Card ---------- */
.ysx-ol-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147482600;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
  box-sizing: border-box;
  overflow-y: auto;
}

.ysx-ol-dialog,
.ysx-ol-inline,
.ysx-ns-card {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #0f172a;
  line-height: 1.62;
  box-sizing: border-box;
  color-scheme: light;
}

.ysx-ol-dialog *,
.ysx-ol-inline *,
.ysx-ns-card * {
  box-sizing: border-box;
}

.ysx-ol-dialog {
  width: min(100%, 660px);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-top: 4px solid #2563eb;
  border-radius: 18px;
  padding: 22px 24px 20px;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.22);
  position: relative;
}

.ysx-ol-inline {
  margin: 16px 0;
  background: linear-gradient(135deg, #fffdf7 0%, #f4f9ff 100%);
  border: 1px solid #93c5fd;
  border-left: 4px solid #2563eb;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
}

.ysx-ol-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ysx-ol-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
}

.ysx-ol-close {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ysx-ol-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.ysx-ol-title {
  margin: 4px 0 8px;
  font-size: 18.5px;
  font-weight: 750;
  color: #0f172a;
  line-height: 1.42;
}

.ysx-ol-meta {
  margin: 0 0 12px;
  padding: 10px 13px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  font-size: 13.5px;
  color: #1e3a8a;
}

.ysx-ol-meta strong {
  color: #1d4ed8;
  font-weight: 700;
}

.ysx-ol-sub {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: #475569;
}

.ysx-ol-routes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ysx-ol-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  text-decoration: none !important;
  color: #0f172a !important;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.ysx-ol-route:hover {
  background: #eff6ff;
  border-color: #60a5fa;
  transform: translateY(-1px);
}

.ysx-ol-route--primary {
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
  border-color: #38bdf8;
}

.ysx-ol-route-main {
  min-width: 0;
  flex: 1;
}

.ysx-ol-route-num {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #0369a1;
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  padding: 1px 8px;
  margin-right: 7px;
}

.ysx-ol-route-label {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.ysx-ol-route-hint {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: #475569;
}

.ysx-ol-route-cta {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.ysx-ol-route--sec .ysx-ol-route-cta {
  background: #ffffff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.ysx-ol-foot {
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 14px;
  font-size: 12.5px;
  color: #64748b;
}

.ysx-ol-linkbtn {
  border: 0;
  background: none;
  color: #2563eb;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 2. Result-Page Next-Step Workflow Card (.ysx-ns-*) ---------- */
.ysx-ns-card,
.ysx-demo-handoff {
  margin: 22px 0 18px;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
  background: linear-gradient(135deg, #f5fbff 0%, #ffffff 60%, #eff6ff 100%);
  color: #0f172a;
  line-height: 1.65;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.07);
}

.ysx-ns-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  margin-bottom: 8px;
}

.ysx-ns-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 750;
  color: #0f172a;
  line-height: 1.4;
}

.ysx-ns-desc {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: #475569;
}

.ysx-ns-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 15px;
}

.ysx-ns-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b !important;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none !important;
}

a.ysx-ns-step:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
  color: #0369a1 !important;
}

.ysx-ns-step-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.ysx-ns-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.ysx-ns-btn-pri,
.ysx-ns-btn-sec,
.ysx-ns-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s ease, transform 0.15s ease;
}

.ysx-ns-btn-pri {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  border: 1px solid #0284c7;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.ysx-ns-btn-pri:hover {
  background: linear-gradient(135deg, #1d4ed8, #0369a1);
  transform: translateY(-1px);
}

.ysx-ns-btn-sec {
  background: #ffffff;
  border: 1px solid #7dd3fc;
  color: #0369a1 !important;
}

.ysx-ns-btn-sec:hover {
  background: #f0f9ff;
}

.ysx-ns-btn-ghost {
  background: transparent;
  border: 0;
  padding: 6px 4px;
  color: #334155 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  font-size: 13px;
}

.ysx-ns-btn-ghost:hover {
  color: #2563eb !important;
}

/* ---------- 3. Shared Inline Lead & Script-Pack Drawer ---------- */
.ysx-ol-drawer,
.ysx-ns-drawer {
  margin-top: 14px;
  padding: 15px 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.ysx-drawer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 16px;
  align-items: start;
}

.ysx-drawer-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.ysx-drawer-list {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 12.5px;
  color: #475569;
}

.ysx-drawer-list li + li {
  margin-top: 3px;
}

.ysx-lead-form {
  display: grid;
  gap: 9px;
}

.ysx-lead-label {
  display: grid;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}

.ysx-lead-input,
.ysx-lead-textarea {
  width: 100%;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 13.5px;
}

.ysx-lead-input:focus,
.ysx-lead-textarea:focus {
  outline: 2px solid #38bdf8;
  border-color: #0284c7;
  background: #ffffff;
}

.ysx-lead-check {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  line-height: 1.5;
}

.ysx-lead-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

.ysx-lead-submit {
  padding: 9px 16px;
  border-radius: 8px;
  border: 0;
  background: #2563eb;
  color: #ffffff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
}

.ysx-lead-submit:hover {
  background: #1d4ed8;
}

.ysx-lead-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.ysx-lead-status {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #0369a1;
  font-weight: 600;
}

.ysx-lead-status--err {
  color: #b91c1c;
}

.ysx-lead-ok {
  padding: 10px 12px;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 13px;
}

.ysx-qr-side {
  padding: 12px;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.ysx-qr-side img {
  display: block;
  width: 124px;
  height: 124px;
  object-fit: contain;
  margin: 0 auto 6px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.ysx-qr-side strong {
  display: block;
  font-size: 12.5px;
  color: #0f172a;
  margin-bottom: 3px;
}

.ysx-qr-side p {
  margin: 0 0 8px;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.45;
}

.ysx-qr-wecom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 10px;
  border-radius: 7px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8 !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
}

@media (max-width: 680px) {
  .ysx-ol-dialog {
    padding: 18px 16px;
  }
  .ysx-ol-route {
    flex-direction: column;
    align-items: flex-start;
  }
  .ysx-ol-route-cta {
    width: 100%;
    text-align: center;
  }
  .ysx-ns-card,
  .ysx-demo-handoff {
    padding: 16px 15px;
  }
  .ysx-ns-btn-pri,
  .ysx-ns-btn-sec {
    width: 100%;
  }
  .ysx-drawer-grid {
    grid-template-columns: 1fr;
  }
}
