/* مِسبار — التمارين · Type 1 — compare (two mocks, pick one, then why + principle)
   Owned by the compare type author. EVERY rule is scoped under .ext-compare.
   Tokens: --ex-* (app surface, theme-aware) and --pp-* (paper mocks, light in both themes).
   Note: the engine mounts its feedback sheet outside the task root, so feedback bodies
   are wrapped in <div class="ext-compare cmp-fbwrap"> to stay inside this scope. */

.ext-compare { gap: 22px; }

/* ---------- header + stepper ---------- */
.ext-compare .cmp-head { display: grid; gap: 10px; }
.ext-compare .cmp-q-t { line-height: 1.4; max-width: 46ch; }
.ext-compare .cmp-steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 4px 0 0; padding: 0; }
.ext-compare .cmp-steps li { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding-inline: 6px 14px; border-radius: 999px; background: var(--ex-s2); border: 1px solid var(--ex-line); color: var(--ex-mut); font-size: 13px; font-weight: 700; transition: color .2s, border-color .2s; }
.ext-compare .cmp-steps li i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ex-s3); color: var(--ex-body); font-size: 12px; font-weight: 800; transition: background .2s, color .2s; }
.ext-compare .cmp-steps li.is-cur { color: var(--ex-ink); border-color: color-mix(in srgb, var(--ex-vio) 55%, var(--ex-line)); }
.ext-compare .cmp-steps li.is-cur i { background: var(--ex-vio); color: var(--ex-on); }
.ext-compare .cmp-steps li.is-done { color: var(--ex-body); }
.ext-compare .cmp-steps li.is-done i { background: var(--ex-ok); color: var(--ex-ok-on); }

/* ---------- the two designs ---------- */
.ext-compare .cmp-duo { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: stretch; scroll-margin-top: 90px; }
.ext-compare .cmp-vs { align-self: center; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ex-s); border: 1px solid var(--ex-line2); color: var(--ex-mut); font-size: 13px; font-weight: 800; }
.ext-compare .cmp-opt { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; align-content: start; gap: 14px; min-width: 0; padding: 14px; border-radius: var(--ex-r); background: var(--ex-s); border: 1.5px solid var(--ex-line); box-shadow: var(--ex-sh); transition: border-color .2s var(--ex-ease), box-shadow .2s var(--ex-ease), opacity .2s; }
.ext-compare .cmp-opt-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 32px; }
.ext-compare .cmp-letter { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--ex-s3); color: var(--ex-ink); font-weight: 900; font-size: 15px; transition: background .2s, color .2s; }
.ext-compare .cmp-opt-t { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 15px; font-weight: 800; color: var(--ex-ink); line-height: 1.4; }
.ext-compare .cmp-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ext-compare .cmp-tags:empty { display: none; }

.ext-compare .cmp-mock { position: relative; display: grid; place-items: center; padding: 22px 12px; border-radius: 16px; cursor: pointer;
  background: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ex-mut) 22%, transparent) 1px, transparent 1.4px) 0 0 / 16px 16px, var(--ex-s2); }
.ext-compare .cmp-mock > .exm-phone { transition: transform .25s var(--ex-ease); }
.ext-compare .cmp-opt:not(.is-annot) .cmp-mock:hover > .exm-phone { transform: translateY(-3px); }
.ext-compare .is-result .cmp-mock, .ext-compare.is-result .cmp-mock { cursor: default; }

.ext-compare .cmp-pickbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px; cursor: pointer; font: inherit; font-size: 15px; font-weight: 800; background: transparent; color: var(--ex-ink); border: 1.5px solid var(--ex-line2); transition: background .18s, color .18s, border-color .18s, transform .12s; }
.ext-compare .cmp-pickbtn:hover:not(:disabled) { background: var(--ex-s2); border-color: color-mix(in srgb, var(--ex-vio) 45%, var(--ex-line2)); }
.ext-compare .cmp-pickbtn:active:not(:disabled) { transform: scale(.985); }
.ext-compare .cmp-pickbtn[aria-pressed="true"] { background: var(--ex-vio); color: var(--ex-on); border-color: var(--ex-vio); }
.ext-compare .cmp-pickbtn:disabled { cursor: default; }

.ext-compare .cmp-opt.is-sel { border-color: var(--ex-vio); box-shadow: 0 0 0 4px var(--ex-t2), var(--ex-sh); }
.ext-compare .cmp-opt.is-sel .cmp-letter { background: var(--ex-vio); color: var(--ex-on); }
.ext-compare .cmp-opt.is-other .cmp-mock > .exm-phone { opacity: .9; }
.ext-compare .cmp-opt.is-tried:not(.is-sel) .cmp-pickbtn { border-style: dashed; color: var(--ex-mut); }

#ex .ext-compare .cmp-pickbtn.is-lockok { opacity: 1; background: var(--ex-okbg); border-color: var(--ex-ok); color: var(--ex-ok); }
#ex .ext-compare .cmp-pickbtn.is-lockok > .cmp-radio { background: var(--ex-ok); border-color: var(--ex-ok); color: var(--ex-ok-on); }
#ex .ext-compare .cmp-choice.is-locked { opacity: 1; }

/* radio marker shared by pick buttons and choices */
.ext-compare .cmp-radio { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 2px solid var(--ex-line2); color: transparent; transition: background .18s, border-color .18s, color .18s; }
.ext-compare [aria-pressed="true"] > .cmp-radio { background: var(--ex-on); border-color: var(--ex-on); color: var(--ex-vio); animation: cmp-pop .28s var(--ex-ease); }
.ext-compare .cmp-choice[aria-pressed="true"] > .cmp-radio { background: var(--ex-vio); border-color: var(--ex-vio); color: var(--ex-on); }

/* ---------- why + principle questions ---------- */
.ext-compare .cmp-flow { display: grid; gap: 16px; }
.ext-compare .cmp-flow[hidden], .ext-compare .cmp-pickbtn[hidden] { display: none; }
.ext-compare .cmp-q { display: grid; gap: 14px; scroll-margin-top: 90px; animation: cmp-up .35s var(--ex-ease) both; }
.ext-compare .cmp-q[hidden] { display: none; }
.ext-compare .cmp-q-h { display: flex; align-items: center; gap: 10px; margin: 0; line-height: 1.4; }
.ext-compare .cmp-q-n { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--ex-t); color: var(--ex-vio); font-size: 14px; font-weight: 900; }
.ext-compare .cmp-choices { display: grid; gap: 10px; }
.ext-compare .cmp-choices--law { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ext-compare .cmp-choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 12px 16px; border-radius: 14px; cursor: pointer; text-align: start; font: inherit; font-size: 15px; font-weight: 600; line-height: 1.6; color: var(--ex-ink); background: var(--ex-s); border: 1.5px solid var(--ex-line); transition: background .18s, border-color .18s, transform .12s; }
.ext-compare .cmp-choice:hover:not(:disabled) { border-color: color-mix(in srgb, var(--ex-vio) 45%, var(--ex-line)); background: var(--ex-s2); }
.ext-compare .cmp-choice:active:not(:disabled) { transform: scale(.99); }
.ext-compare .cmp-choice[aria-pressed="true"] { border-color: var(--ex-vio); background: var(--ex-t); }
.ext-compare .cmp-choice-tx { flex: 1 1 auto; min-width: 0; }
.ext-compare .cmp-choice-st { flex: none; font-size: 12px; font-weight: 800; color: var(--ex-mut); }
.ext-compare .cmp-choice-st:empty { display: none; }
.ext-compare .cmp-choice.is-tried { border-style: dashed; color: var(--ex-mut); }
.ext-compare .cmp-choice.is-locked { border-color: var(--ex-ok); background: var(--ex-okbg); cursor: default; }
.ext-compare .cmp-choice.is-locked > .cmp-radio { background: var(--ex-ok); border-color: var(--ex-ok); color: var(--ex-ok-on); }
.ext-compare .cmp-choice.is-locked .cmp-choice-st { color: var(--ex-ok); }
.ext-compare .cmp-choice:disabled:not(.is-locked) { opacity: .55; cursor: default; }

.ext-compare .cmp-submit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ext-compare .cmp-submit .ex-cta:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; transform: none; }
.ext-compare .cmp-submit-note:empty { display: none; }

/* ---------- result: annotations on the mocks ---------- */
.ext-compare .cmp-opt.is-better { --cmp-tone: var(--pp-ok); border-color: color-mix(in srgb, var(--ex-ok) 70%, var(--ex-line)); }
.ext-compare .cmp-opt.is-weaker { --cmp-tone: var(--pp-warn); }
.ext-compare .cmp-opt.is-better .cmp-letter { background: var(--ex-ok); color: var(--ex-ok-on); }
.ext-compare .cmp-opt.is-annot .cmp-annel { position: relative; outline: 2.5px solid var(--cmp-tone); outline-offset: 2px; border-radius: 10px; animation: cmp-ring .5s var(--ex-ease) both; }
.ext-compare .cmp-pin { position: absolute; z-index: 9; top: -9px; inset-inline-end: -9px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; line-height: 1; color: #fff; background: var(--cmp-tone, var(--pp-brand)); box-shadow: 0 0 0 2.5px #fff, 0 3px 8px rgba(0,0,0,.25); animation: cmp-pop .35s var(--ex-ease) both; }
.ext-compare .cmpm-hbtn > .cmp-pin { top: auto; bottom: -8px; }
.ext-compare .cmp-pin--static { position: static; flex: none; box-shadow: none; animation: none; margin-top: 2px; }
.ext-compare .cmp-notes { align-self: start; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ext-compare .cmp-notes[hidden] { display: none; }
.ext-compare .cmp-notes li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.75; color: var(--ex-body); animation: cmp-up .35s var(--ex-ease) both; }
.ext-compare .cmp-notes li:nth-child(2) { animation-delay: .08s; }
.ext-compare .cmp-opt.is-better .cmp-notes .cmp-pin { background: var(--ex-ok); color: var(--ex-ok-on); }
.ext-compare .cmp-opt.is-weaker .cmp-notes .cmp-pin { background: var(--ex-close); color: var(--ex-close-on); }
.ext-compare .cmp-tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; animation: cmp-pop .3s var(--ex-ease) both; }
.ext-compare .cmp-tag.is-better { background: var(--ex-okbg); color: var(--ex-ok); }
.ext-compare .cmp-tag.is-weaker { background: var(--ex-closebg); color: var(--ex-close); }
.ext-compare .cmp-tag.is-yours { background: var(--ex-t); color: var(--ex-vio); }

.ext-compare .cmp-result { display: grid; gap: 16px; animation: cmp-up .4s var(--ex-ease) both; }
.ext-compare .cmp-result[hidden] { display: none; }
.ext-compare .cmp-res-t { margin: 0; line-height: 1.35; }
.ext-compare .cmp-res-sub { margin: -8px 0 0; font-size: 14px; }
.ext-compare .cmp-analysis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ext-compare .cmp-an { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; }
.ext-compare .cmp-an h4 { margin: 0 0 6px; font-size: 15.5px; font-weight: 800; color: var(--ex-ink); line-height: 1.4; }
.ext-compare .cmp-an p { margin: 0; font-size: 14.5px; line-height: 1.85; color: var(--ex-body); }
.ext-compare .cmp-an-ic { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; }
.ext-compare .cmp-an.is-better .cmp-an-ic { background: var(--ex-okbg); color: var(--ex-ok); }
.ext-compare .cmp-an.is-weaker .cmp-an-ic { background: var(--ex-closebg); color: var(--ex-close); }
.ext-compare .cmp-recap { display: grid; gap: 8px; padding: 16px 20px; }
.ext-compare .cmp-recap p { margin: 0; font-size: 15px; line-height: 1.8; color: var(--ex-body); }
.ext-compare .cmp-recap b { color: var(--ex-ink); }

/* ---------- feedback sheet body (wrapped in .ext-compare.cmp-fbwrap) ---------- */
.ext-compare.cmp-fbwrap { display: grid; gap: 12px; animation: none; }
.ext-compare.cmp-fbwrap > p { margin: 0; }
.ext-compare .cmp-fb { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ext-compare .cmp-fbrow { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--ex-s2); border: 1px solid var(--ex-line); }
.ext-compare .cmp-fbic { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; margin-top: 1px; }
.ext-compare .cmp-fbrow.is-ok .cmp-fbic { background: var(--ex-ok); color: var(--ex-ok-on); }
.ext-compare .cmp-fbrow.is-close .cmp-fbic { background: var(--ex-close); color: var(--ex-close-on); }
.ext-compare .cmp-fbtx { display: grid; gap: 2px; min-width: 0; }
.ext-compare .cmp-fbtx small { font-size: 12px; font-weight: 700; color: var(--ex-mut); }
.ext-compare .cmp-fbtx b { font-size: 14.5px; font-weight: 700; color: var(--ex-ink); line-height: 1.6; }
.ext-compare .cmp-fbtx em { font-style: normal; font-size: 13.5px; color: var(--ex-body); line-height: 1.75; }
.ext-compare .cmp-fbhint { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--ex-closebg); color: var(--ex-close); font-weight: 700; }
.ext-compare .cmp-fbhint span { color: var(--ex-ink); line-height: 1.75; }
.ext-compare .cmp-fbhint svg { flex: none; margin-top: 4px; }

/* ================= mock-only pieces (paper, light in both themes) ================= */
.ext-compare .cmpm-scroll { flex: 1 1 auto; min-height: 0; overflow: hidden; display: grid; align-content: start; gap: 10px; padding: 4px 12px 12px; }
.ext-compare .cmpm-store { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--pp-mut); padding: 2px 4px 0; }
.ext-compare .cmpm-group { background: var(--pp-bg); border-radius: 14px; border: 1px solid var(--pp-line); padding: 4px 12px; display: grid; }
.ext-compare .cmpm-item, .ext-compare .cmpm-line { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 6px 0; }
.ext-compare .cmpm-item + .cmpm-item, .ext-compare .cmpm-line + .cmpm-line { border-top: 1px solid var(--pp-line); }
.ext-compare .cmpm-art { flex: none; display: block; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; }
.ext-compare .cmpm-art svg { width: 40px; height: 40px; display: block; }
.ext-compare .cmpm-item-tx { flex: 1 1 auto; min-width: 0; display: grid; line-height: 1.35; }
.ext-compare .cmpm-item-tx b { font-size: 13px; font-weight: 700; color: var(--pp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-compare .cmpm-item-tx small { font-size: 11px; color: var(--pp-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-compare .cmpm-item .exm-price, .ext-compare .cmpm-totals .exm-price, .ext-compare .cmpm-paysum .exm-price { flex: none; flex-wrap: nowrap; white-space: nowrap; }
.ext-compare .cmpm-ltr { text-align: end; letter-spacing: .04em; }
.ext-compare .cmpm-ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--pp-brand-soft); color: var(--pp-brand); }
.ext-compare .cmpm-link { flex: none; font-size: 12px; font-weight: 700; color: var(--pp-brand); }
.ext-compare .cmpm-totals { padding: 8px 12px; gap: 4px; }
.ext-compare .cmpm-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--pp-body); }
.ext-compare .cmpm-totals > div.is-grand { padding-top: 6px; margin-top: 2px; border-top: 1px dashed var(--pp-line2); font-weight: 800; color: var(--pp-ink); font-size: 13.5px; }
.ext-compare .cmpm-totals small { font-weight: 500; font-size: 10.5px; color: var(--pp-mut); }
.ext-compare .cmpm-toplink { display: inline-block; font-size: 13px; font-weight: 700; color: var(--pp-brand); padding: 2px 4px; }
.ext-compare .cmpm-paybar { flex: none; display: grid; gap: 8px; padding: 10px 12px 26px; background: rgba(255,255,255,.97); border-top: 1px solid var(--pp-line); box-shadow: 0 -6px 16px rgba(17,17,20,.06); }
.ext-compare .cmpm-paybar { position: relative; }
.ext-compare .cmpm-paybar::before { content: ""; position: absolute; inset-inline: 0; bottom: 100%; height: 26px; background: linear-gradient(to top, rgba(242,242,247,.95), rgba(242,242,247,0)); pointer-events: none; }
.ext-compare .cmpm-paysum { display: flex; align-items: baseline; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--pp-body); padding: 0 2px; }
.ext-compare .cmpm-paybar .exm-btn { height: 50px; }

/* store (jakob) */
.ext-compare .cmpm-shop { flex: 1 1 auto; min-height: 0; overflow: hidden; display: grid; align-content: start; gap: 10px; background: var(--pp-bg); padding-bottom: 8px; }
.ext-compare .cmpm-header { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 0 8px; height: 46px; }
.ext-compare .cmpm-header .cmpm-hbtn:last-child { justify-self: end; }
.ext-compare .cmpm-logo { justify-self: center; display: inline-flex; align-items: center; gap: 5px; font-size: 18px; font-weight: 900; color: var(--pp-ink); }
.ext-compare .cmpm-hbtn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; color: var(--pp-ink); border-radius: 10px; }
.ext-compare .cmpm-dot { position: absolute; top: 2px; inset-inline-start: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #D92D20; color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px #fff; }
.ext-compare .cmpm-pad { padding: 0 12px; }
.ext-compare .cmpm-chips { display: flex; gap: 6px; padding: 10px 12px 0; margin-top: -10px; overflow: hidden; }
.ext-compare .cmpm-chips > span { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--pp-line2); background: var(--pp-bg); font-size: 12.5px; font-weight: 600; color: var(--pp-body); }
.ext-compare .cmpm-chips > span.is-on { background: var(--pp-ink); border-color: var(--pp-ink); color: #fff; }
.ext-compare .cmpm-banner { margin: 0 12px; padding: 14px; border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: linear-gradient(135deg, #1F4536, #2E7D5B); color: #fff; }
.ext-compare .cmpm-banner span:first-child { display: grid; gap: 2px; }
.ext-compare .cmpm-banner small { font-size: 11px; opacity: .8; }
.ext-compare .cmpm-banner b { font-size: 14px; font-weight: 800; line-height: 1.4; }
.ext-compare .cmpm-banner-cta { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; background: #fff; color: #1F4536; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.ext-compare .cmpm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 12px; }
.ext-compare .cmpm-prod { display: grid; gap: 2px; align-content: start; min-width: 0; }
.ext-compare .cmpm-prod-art { display: block; height: 84px; border-radius: 12px; overflow: hidden; margin-bottom: 4px; }
.ext-compare .cmpm-prod b { font-size: 12.5px; font-weight: 700; color: var(--pp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-compare .cmpm-prod small { font-size: 11px; color: var(--pp-mut); }

/* ---------- motion ---------- */
@keyframes cmp-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cmp-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes cmp-ring { from { outline-color: transparent; outline-offset: 8px; } to { outline-offset: 2px; } }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .ext-compare .cmp-duo { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ext-compare .cmp-vs { justify-self: center; }
  .ext-compare .cmp-analysis { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .ext-compare .cmp-opt { padding: 12px; }
  .ext-compare .cmp-mock { padding: 16px 8px; }
  .ext-compare .cmp-choices--law { grid-template-columns: minmax(0, 1fr); }
  .ext-compare .cmp-choice { font-size: 14.5px; padding: 12px 14px; }
  .ext-compare .cmp-submit .ex-cta { width: 100%; justify-content: space-between; }
  .ext-compare .cmp-an { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ext-compare *, .ext-compare *::before, .ext-compare *::after,
  .ext-compare.cmp-fbwrap * { animation: none !important; transition: none !important; }
  .ext-compare .cmp-opt:not(.is-annot) .cmp-mock:hover > .exm-phone { transform: none; }
}
