.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #71a74a, #baff6a);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 8px rgba(186, 255, 106, 0.6);
}

.button.quiz-btn {
  background: linear-gradient(135deg, #1f3627, #13241b);
  border: 1px solid #71a74a;
  color: #c9ff85;
  box-shadow: 0 4px 18px rgba(27, 48, 35, 0.35);
  cursor: pointer;
}
.button.quiz-btn:hover {
  background: linear-gradient(135deg, #2a4835, #193124);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(113, 167, 74, 0.25);
}

.floating-quiz-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #17241e;
  color: #fff;
  border: 1px solid #71a74a66;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(16, 26, 20, 0.25);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s, background 0.2s;
}
.floating-quiz-fab:hover {
  transform: translateY(-3px) scale(1.02);
  background: #23372d;
  box-shadow: 0 14px 36px rgba(16, 26, 20, 0.35);
  border-color: #8bbd60;
}
.floating-quiz-fab .fab-icon {
  font-size: 16px;
  line-height: 1;
}

.quiz-smart-toast {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 850;
  max-width: 320px;
  background: #ffffff;
  border: 1px solid #dce5da;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 18px 45px rgba(20, 36, 30, 0.16);
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.quiz-smart-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.toast-badge {
  font-size: 11px;
  font-weight: 800;
  color: #557047;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.toast-close {
  background: none;
  border: none;
  color: #8c9991;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.toast-close:hover {
  color: #17241e;
}
.toast-body h4 {
  margin: 0 0 5px;
  font-size: 14px;
  color: #17241e;
  font-weight: 750;
}
.toast-body p {
  margin: 0 0 12px;
  font-size: 12px;
  color: #63716a;
  line-height: 1.5;
}
.toast-actions {
  display: flex;
  gap: 8px;
}
.toast-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  background: #17241e;
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.18s;
}
.toast-btn:hover {
  background: #2b4035;
}
.toast-dismiss {
  padding: 8px 10px;
  background: transparent;
  border: 1px solid #dce5da;
  border-radius: 999px;
  color: #6a7770;
  font-size: 11px;
  cursor: pointer;
}
.toast-dismiss:hover {
  background: #f4f6f2;
}

.quiz-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 26, 22, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.quiz-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.quiz-card {
  position: relative;
  width: min(600px, 100%);
  min-height: 520px;
  max-height: min(92vh, 760px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e3e8e2;
  border-radius: 24px;
  padding: 32px 34px;
  box-shadow: 0 28px 80px rgba(16, 26, 22, 0.28);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.quiz-modal-overlay.is-open .quiz-card {
  transform: translateY(0) scale(1);
}

.quiz-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e2e8e0;
  background: #f7f9f6;
  color: #55635b;
  display: grid;
  place-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.quiz-close-btn:hover {
  background: #e9eee6;
  color: #17241e;
}

.quiz-kicker {
  margin: 0;
  color: #557047;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.quiz-card h2 {
  margin: 8px 40px 6px 0;
  font-size: 26px;
  line-height: 1.22;
  letter-spacing: -0.04em;
  color: #14241e;
}
.quiz-intro {
  margin: 0 0 20px;
  color: #65736d;
  font-size: 14px;
  line-height: 1.5;
}

.quiz-progress-track {
  height: 6px;
  margin: 0 0 24px;
  border-radius: 99px;
  background: #edf1e9;
  overflow: hidden;
}
.quiz-progress-fill {
  display: block;
  width: 25%;
  height: 100%;
  background: linear-gradient(90deg, #6ea546, #9fd968);
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-step-pane {
  display: none;
  animation: stepFadeIn 0.25s ease-out;
}
.quiz-step-pane.is-active {
  display: block;
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.quiz-question-title {
  font-size: 16px;
  font-weight: 750;
  color: #1a2a22;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.quiz-option-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border: 1.5px solid #dce3db;
  border-radius: 14px;
  background: #fbfcf9;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.quiz-option-card:hover {
  border-color: #71a74a;
  background: #f3f7ef;
  transform: translateY(-1px);
}
.quiz-option-card.is-selected {
  border-color: #63983d;
  background: #eef6e8;
  color: #172b1d;
  box-shadow: 0 4px 14px rgba(99, 152, 61, 0.18);
}
.quiz-option-card span {
  font-size: 14px;
  font-weight: 600;
  color: #27382d;
}
.quiz-option-card .check-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #b7c4b4;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: transparent;
  transition: all 0.18s;
}
.quiz-option-card.is-selected .check-circle {
  background: #63983d;
  border-color: #63983d;
  color: #fff;
}

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  border-top: 1px solid #edf1eb;
  padding-top: 18px;
}
.quiz-step-indicator {
  font-size: 13px;
  color: #6e7d73;
  font-weight: 600;
}
.quiz-nav-btns {
  display: flex;
  gap: 10px;
}
.quiz-btn-prev, .quiz-btn-next {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}
.quiz-btn-prev {
  background: transparent;
  border: 1px solid #d5ded3;
  color: #55665c;
}
.quiz-btn-prev:hover {
  background: #f0f4ed;
  color: #17241e;
}
.quiz-btn-next {
  background: #17241e;
  border: 1px solid #17241e;
  color: #fff;
}
.quiz-btn-next:hover {
  background: #2a3e33;
}
.quiz-btn-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quiz-analyzing-pane {
  display: none;
  text-align: center;
  padding: 40px 10px;
}
.quiz-analyzing-pane.is-active {
  display: block;
}
.radar-scanner {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 24px;
}
.radar-ring {
  position: absolute;
  inset: 0;
  border: 3px solid #e3ede0;
  border-top-color: #6ea546;
  border-radius: 50%;
  animation: radarSpin 0.9s linear infinite;
}
.radar-percent {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: #27382d;
}
@keyframes radarSpin {
  to { transform: rotate(360deg); }
}
.quiz-analyzing-pane h3 {
  margin: 0 0 10px;
  font-size: 20px;
  color: #17241e;
}
.quiz-analyzing-pane p {
  margin: 0;
  color: #63716a;
  font-size: 13px;
  line-height: 1.6;
}

.quiz-result-pane {
  display: none;
  animation: resultSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.quiz-result-pane.is-active {
  display: block;
}
@keyframes resultSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-header {
  margin-bottom: 16px;
}
.result-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #557047;
}
.quiz-result-pane h3 {
  margin: 6px 0 0;
  font-size: 22px;
  color: #14241e;
}

.result-card-box {
  background: #f4f8f1;
  border: 1.5px solid #d4e5cc;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 18px;
  align-items: center;
}
.result-card-img {
  width: 80px;
  height: 80px;
  background: #ffffff;
  border-radius: 12px;
  padding: 6px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(27, 45, 33, 0.08);
}
.result-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.result-card-meta h4 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #17241e;
}
.result-card-meta .result-tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.result-tag-row .tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: #e3efdd;
  color: #385732;
}
.result-card-meta p {
  margin: 0;
  font-size: 12px;
  color: #516356;
  line-height: 1.55;
}
.result-note {
  font-size: 11px;
  color: #79877f;
  margin: 0 0 20px;
  line-height: 1.6;
}
.result-action-row {
  display: flex;
  gap: 12px;
}
.result-action-row button {
  flex: 1;
  min-height: 46px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s;
}
.btn-highlight-view {
  background: #17241e;
  border: 1px solid #17241e;
  color: #fff;
}
.btn-highlight-view:hover {
  background: #2b4035;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(23, 36, 30, 0.25);
}
.btn-retake {
  background: transparent;
  border: 1px solid #cfd8ce;
  color: #4b5a51;
}
.btn-retake:hover {
  background: #edf2eb;
}

.product.is-highlighted {
  outline: 3px solid #71a74a !important;
  box-shadow: 0 0 35px rgba(113, 167, 74, 0.45) !important;
  animation: pulseGlow 1.8s ease-in-out infinite alternate;
}
@keyframes pulseGlow {
  from { box-shadow: 0 0 20px rgba(113, 167, 74, 0.3); }
  to { box-shadow: 0 0 45px rgba(113, 167, 74, 0.6); }
}

@media(max-width: 580px) {
  .quiz-card {
    padding: 24px 20px;
    border-radius: 20px;
  }
  .quiz-card h2 {
    font-size: 22px;
  }
  .result-card-box {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .result-card-img {
    margin: 0 auto;
  }
  .result-card-meta .result-tag-row {
    justify-content: center;
  }
  .result-action-row {
    flex-direction: column;
  }
  .floating-quiz-fab {
    right: 16px;
    bottom: 16px;
    padding: 10px 14px;
    font-size: 12px;
  }
  .quiz-smart-toast {
    right: 16px;
    bottom: 74px;
    max-width: calc(100vw - 32px);
  }
}

[dir="rtl"] .floating-quiz-fab {
  right: auto;
  left: 24px;
}
[dir="rtl"] .quiz-smart-toast {
  right: auto;
  left: 24px;
}
[dir="rtl"] .quiz-close-btn {
  right: auto;
  left: 24px;
}
[dir="rtl"] .quiz-option-card {
  text-align: right;
}
[dir="rtl"] .result-card-box {
  text-align: right;
}
@media(max-width: 580px) {
  [dir="rtl"] .floating-quiz-fab {
    right: auto;
    left: 16px;
  }
  [dir="rtl"] .quiz-smart-toast {
    right: auto;
    left: 16px;
  }
}
