/* ======================================================
   Base
====================================================== */

.jie-noscroll {
  overflow: hidden !important;
}

.jie-overlay {
  /* Theme variables */
  --jie-primary: #111;
  --jie-primary-hover: #000;
  --jie-text: #111;
  --jie-panel-bg: #fff;
  --jie-overlay-bg: rgba(10, 10, 12, 0.62);
  --jie-header-from: rgba(17,17,18,1);
  --jie-header-to: rgba(40,40,46,1);
  --jie-accent-from: #111;
  --jie-accent-to: #444;

  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: var(--jie-overlay-bg);
  backdrop-filter: blur(10px);
}

.jie-panel {
  width: min(760px, 100%);
  min-height: 420px;
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: var(--jie-panel-bg);
  box-shadow: 0 28px 80px rgba(0,0,0,.35);
  animation: jieIn .18s ease-out forwards;
}

@keyframes jieIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ======================================================
   Header
====================================================== */

.jie-header {
  position: relative;
  padding: 18px 18px 14px;
  background: linear-gradient(135deg, var(--jie-header-from), var(--jie-header-to));
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}

.jie-title {
  font-size: 16px;
  line-height: 1.2;
}

.jie-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
.jie-close:hover { background: rgba(255,255,255,.18); }

/* ======================================================
   Body
====================================================== */

.jie-body {
  padding: 22px 28px;
  overflow: auto;
}

/* Body title (start/result screens) */
.jie-h1 {
  max-width: 520px;
  margin: 0 auto 6px;
  font-size: 22px;
  line-height: 1.25;
  color: var(--jie-text);
}

/* ======================================================
   Typography
====================================================== */

.jie-intro {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(0,0,0,.72);
}

.jie-question {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.25;
  color: var(--jie-text);
}

.jie-help {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,.04);
  font-size: 13px;
  color: rgba(0,0,0,.72);
}

/* ======================================================
   Fields
====================================================== */

.jie-field {
  margin: 10px 0 12px;
}

.jie-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: rgba(0,0,0,.65);
}

.jie-input {
  width: 100%;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
}
.jie-input:focus {
  outline: none;
  border-color: rgba(0,0,0,.45);
  box-shadow: 0 0 0 4px rgba(0,0,0,.08);
}

/* ======================================================
   Actions
====================================================== */

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

.jie-primary,
.jie-secondary {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  cursor: pointer;
}

.jie-primary {
  background: var(--jie-primary);
  color: #fff;
  box-shadow: 0 12px 22px rgba(0,0,0,.14);
}
.jie-primary:hover { background: var(--jie-primary-hover); }

.jie-secondary {
  background: rgba(0,0,0,.06);
  color: var(--jie-text);
}
.jie-secondary:hover { background: rgba(0,0,0,.09); }

.jie-primary[disabled] {
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
}

/* ======================================================
   Start screen layout
====================================================== */

.jie-start {
  max-width: 560px;
  margin: 0 auto;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  transform: translateY(-16px);
}

.jie-start-intro,
.jie-start-block {
  max-width: 520px;
  margin: 0 auto;
}

/* Intro as subtle callout */
.jie-start-intro .jie-intro {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,.03);
}

/* Full-width CTA */
.jie-start-block .jie-primary {
  width: 100%;
}

/* ======================================================
   Answers (cards)
====================================================== */

.jie-answers {
  display: grid;
  gap: 10px;
  margin: 8px 0 16px;
}

.jie-answer {
  width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  font-size: 14px;
  color: var(--jie-text);
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.jie-answer:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}

/* ======================================================
   Progress
====================================================== */

.jie-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.jie-progress-text {
  font-size: 12px;
  color: rgba(0,0,0,.6);
}

.jie-progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow: hidden;
}

.jie-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--jie-accent-from), var(--jie-accent-to));
  transition: width .22s ease;
}

/* ======================================================
   Mobile
====================================================== */

@media (max-width: 520px) {
  .jie-body { padding: 16px 18px; }
  .jie-question { font-size: 17px; }
  .jie-actions { flex-direction: column; }
}
