/* Review-screen explanation layout (TCM.explain in explain.js): MOCK modules and the free diagnostic. */
.x2 { display: flex; flex-direction: column; gap: 28px; }
.x2 h4 { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; letter-spacing: 0.01em; color: var(--ink-2); margin: 0 0 10px; }
.x2 h4 svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.x2 .md { font-size: 1.125rem; line-height: 1.75; gap: 12px; }

/* answer: two tiles */
.x2-ans { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 0; }
.x2-ans > div { border-radius: 12px; padding: 14px 16px; background: var(--soft); }
.x2-ans dt { font-size: 0.9375rem; color: var(--muted); margin-bottom: 4px; }
.x2-ans dd { margin: 0; font-weight: 600; line-height: 1.55; }
.x2-ans .key { background: var(--ok-soft); }
.x2-ans .key dt { color: var(--ok); font-weight: 600; }
.x2-ans .mine.bad { background: var(--bad-soft); }
.x2-ans .mine.bad dt { color: var(--bad); font-weight: 600; }
.x2-ans .mine.bad dd { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--ink-2); }
.x2-meta { font-size: 0.9375rem; color: var(--muted); margin-top: -18px; }

/* solving steps: numbered rail */
.x2-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.x2-steps li { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; }
.x2-steps li:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; border-left: 2px solid var(--line); }
.x2-steps .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--soft-2); color: var(--ink-2); font-size: 0.9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.x2-steps li.last .n { background: var(--accent); color: var(--on-accent); }
.x2-steps .t { font-size: 1.0625rem; line-height: 1.7; padding-top: 2px; }
.x2-steps .t b { display: block; font-weight: 650; color: var(--ink); }
.x2-steps .t span { color: var(--ink-2); }
.x2-note { font-size: 1rem; color: var(--ink-2); background: var(--soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }

/* main reasoning */
.x2-main .md { font-size: 1.1875rem; }

/* other options: letter badges */
.x2-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.x2-opts li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; font-size: 1.0625rem; line-height: 1.7; color: var(--ink-2); }
.x2-opts .k { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line); font-size: 0.9375rem; font-weight: 700; color: var(--muted); }

/* trap / remember: quiet tinted panels with a rule */
.x2-trap, .x2-rem { border-radius: 12px; padding: 16px 18px 16px 20px; border-left: 4px solid; }
.x2-trap { background: var(--caution-soft); border-color: var(--caution); }
.x2-trap h4, .x2-trap h4 svg { color: var(--caution); }
.x2-rem { background: var(--accent-soft); border-color: var(--accent); }
.x2-rem h4, .x2-rem h4 svg { color: var(--accent-ink); }
.x2-trap .md, .x2-rem .md { font-size: 1.0625rem; }

/* study note: its own card */
.x2-study { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.x2-study > header { display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: var(--soft); border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 700; color: var(--ink-2); }
.x2-study > header svg { width: 18px; height: 18px; color: var(--accent); }
.x2-study > .md { padding: 16px 18px 18px; font-size: 1.0625rem; }
.x2-study .md > p:first-child { font-size: 1.125rem; }
.x2-study .md > p:first-child em { display: block; font-style: normal; font-size: 0.9375rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.x2-study table { font-size: 1rem; line-height: 1.6; }
.x2-study th { background: var(--soft); color: var(--ink-2); font-size: 0.9375rem; white-space: normal; }
.x2-study td { padding: 10px 12px; }
.x2-study td:first-child { font-weight: 600; color: var(--ink); }
.x2-study tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--soft) 55%, transparent); }
.x2-study td strong { color: var(--accent-ink); }
.x2-study .table-wrap { border: 1px solid var(--line); border-radius: 10px; }

/* folded extras */
.x2-fold { border-top: 1px solid var(--line); }
.x2-fold:last-of-type { border-bottom: 1px solid var(--line); }
.x2-fold summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 14px 2px; font-size: 1rem; font-weight: 600; color: var(--ink-2); }
.x2-fold summary::-webkit-details-marker { display: none; }
.x2-fold summary .sub { font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.x2-fold summary svg { width: 18px; height: 18px; color: var(--muted); flex: none; transition: transform .2s; }
.x2-fold[open] summary .chev { transform: rotate(180deg); }
.x2-fold > .in { padding: 0 2px 16px; }
.x2-fold .quote { font-size: 1rem; line-height: 1.7; color: var(--ink-2); border-left: 3px solid var(--line); padding-left: 14px; white-space: pre-line; }
.x2-folds { display: flex; flex-direction: column; }
.x2-report { font-size: 0.9375rem; color: var(--muted); align-self: flex-end; }
.x2-report a { color: var(--muted); }

@media (max-width: 640px) {
  .x2 { gap: 24px; }
  .x2-ans { grid-template-columns: 1fr; }
  .x2-main .md { font-size: 1.125rem; }
  .x2-study > .md { padding: 14px 14px 16px; }
  .x2-trap, .x2-rem { padding: 14px 14px 14px 16px; }
}
/* top part: reasoning on the left, Trap / Remember on the right (wide screens) */
.x2-top, .x2-col, .x2-side { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
@media (min-width: 1000px) {
  .rv .body:has(.x2) { max-width: none; padding-right: 8px; }
  .x2-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.5fr); gap: 40px; align-items: start; }
  .x2-side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 96px); gap: 16px; }
  .x2-col .md, .x2-main .md { max-width: 68ch; }
}
/* large monitors: the review list uses more of the screen than the 1080px page column */
@media (min-width: 1360px) {
  .review-wide { margin-inline: calc((min(100vw - 64px, 1240px) - 100%) / -2); }
}

/* phones: study-note tables become one card per row */
@media (max-width: 640px) {
  .x2-study .table-wrap { border: 0; border-radius: 0; overflow: visible; }
  .x2-study table, .x2-study tbody, .x2-study tr, .x2-study td { display: block; width: 100%; }
  .x2-study thead { display: none; }
  .x2-study tr { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
  .x2-study tbody tr:nth-child(even) td { background: none; }
  .x2-study td { border: 0; padding: 3px 0; }
  .x2-study td:first-child { font-size: 1.0625rem; padding-bottom: 6px; }
  .x2-study td:not(:first-child)::before { content: attr(data-label); display: block; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
  .x2-study td:empty, .x2-study td:not(:first-child):is(:empty) { display: none; }
}
/* case panel (case items) */
.x2-case { border-radius: 14px; background: var(--soft); overflow: hidden; }
.x2-case > header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 14px 18px 0; font-size: 1.125rem; font-weight: 700; }
.x2-case .tag { font-size: 0.875rem; font-weight: 700; color: var(--cc); background: var(--cc-soft); border-radius: 999px; padding: 2px 10px; }
.x2-case .in { padding: 10px 18px 16px; font-size: 1.0625rem; line-height: 1.7; color: var(--ink); }
.x2-case .intro { margin-bottom: 10px; }
.x2-case h5 { margin: 6px 0 4px; font-size: 0.9375rem; font-weight: 700; color: var(--muted); }
.x2-case ul { margin: 0; padding-left: 1.2em; display: grid; gap: 2px 32px; }
.x2-case li.kv { list-style: none; margin-left: -1.2em; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 6px 10px; margin-top: 4px; border-radius: 8px; background: var(--surface); }
.x2-case li.kv b { font-size: 0.9375rem; color: var(--muted); padding-top: 1px; }
@media (min-width: 1000px) { .x2-case ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } .x2-case li.kv { grid-column: 1 / -1; } }
/* the question with every option, marked */
.x2-q .stem { font-size: 1.125rem; font-weight: 600; margin-bottom: 10px; }
.x2-choices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.x2-choices li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 1.0625rem; line-height: 1.6; color: var(--ink-2); }
.x2-choices .k { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 0.9375rem; font-weight: 700; color: var(--ink-2); }
.x2-choices .lab { font-size: 0.875rem; font-weight: 700; white-space: nowrap; padding-top: 3px; }
.x2-choices li.key { border-color: var(--ok); background: var(--ok-soft); color: var(--ink); font-weight: 600; }
.x2-choices li.key .k { background: var(--ok); color: var(--on-accent); }
.x2-choices li.key .lab { color: var(--ok); }
.x2-choices li.mine { border-color: var(--bad); background: var(--bad-soft); }
.x2-choices li.mine .k { background: var(--bad); color: #fff; }
.x2-choices li.mine .lab { color: var(--bad); }
@media (max-width: 640px) { .x2-choices li { grid-template-columns: 28px minmax(0, 1fr); } .x2-choices .lab { grid-column: 2; padding-top: 0; } }
.x2-q { max-width: 880px; }
