/* Core practice test as a quiz tool (v2): top line, one tool card, then supporting sections.
   Tokens from /ui.css; question/option looks from /css/ui-quiz.css, flattened inside the card. */

/* ── Top: breadcrumb, H1, one meta line ── */
.ct-top { padding: var(--s3, 21px) 0 var(--s2, 13px); }
.ct-top .breadcrumb { margin: -10px 0 0; }
.ct-top h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.618rem); line-height: 1.08; }
.ct-lead { margin-top: 8px; max-width: 60ch; font-family: var(--f-body); font-size: 1.0625rem; line-height: 1.5; color: var(--ink2); }
@media (min-width: 961px) { .ct-lead { font-size: 1.125rem; } }

/* ── Tool section ── */
.ct-sec-tool { padding: var(--s1, 8px) 0 var(--s5, 55px); }
.ct { scroll-margin-top: 72px; background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r3);
  box-shadow: 0 1px 2px rgba(15,31,61,.06), 0 21px 55px -21px rgba(15,31,61,.28);
  display: grid; grid-template-columns: minmax(0, 1fr); }

/* dark bar: dots · position · progress · timer */
.ct-bar { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 8px 6px 18px;
  background: var(--nv); color: var(--nt2); border-radius: var(--r3) var(--r3) 0 0; font-family: var(--f-mono); font-size: 14px; }
.ct-bar .qc-dots { display: inline-flex; gap: 6px; }
.ct-bar .qc-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--nline2); }
.ct-bar .qc-dots i:first-child { background: var(--or); }
.ct-pos { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--nt2); }
.ct-pos b { color: #fff; font-weight: 700; }
.ct-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--nline2); }
.ct-prog i { display: block; height: 100%; width: 0; background: var(--or); transition: width .3s ease; }
.ct-timer { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  background: transparent; color: #fff; border: 1px solid var(--nline2); border-radius: var(--r2);
  font: 600 14px/1 var(--f-mono); cursor: pointer; }
.ct-timer:hover:not(:disabled) { border-color: var(--or); }
.ct-timer.is-on { cursor: default; border-color: var(--nline2); font-variant-numeric: tabular-nums; }
.ct-timer.is-low { color: var(--or); border-color: var(--or); }
.ct-timer:disabled:not(.is-on) { color: var(--nt2); cursor: default; }

/* mode + grid button row */
.ct-subbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.ct-mode { display: inline-flex; padding: 3px; gap: 3px; background: var(--bg3); border-radius: var(--r2); }
.ct-mode button { min-height: 44px; padding: 0 18px; border: 0; border-radius: calc(var(--r2) - 2px); background: transparent;
  font: 600 15px/1 var(--f-body); color: var(--ink2); cursor: pointer; }
.ct-mode button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(15,31,61,.14); }
.ct-mode-hint { font-size: 14px; color: var(--ink2); }
.ct[data-mode="practice"] .ct-mode-hint--exam, .ct[data-mode="exam"] .ct-mode-hint--practice { display: none; }
.ct-gridbtn { display: none; flex: none; white-space: nowrap; min-height: 44px; padding: 0 14px; border: 1px solid var(--line2); border-radius: var(--r2);
  background: var(--bg); font: 700 15px/1 var(--f-mono); color: var(--ink); cursor: pointer; }

/* inline confirm */
.ct-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 18px;
  background: var(--ordim); border-bottom: 1px solid var(--line); }
.ct-ask[hidden] { display: none; }
.ct-ask p { font-size: 15px; line-height: 1.45; color: var(--ink); font-weight: 600; }
.ct-ask div { display: flex; gap: 8px; }
.ct-ask .u-btn { min-height: 44px; padding: 10px 18px; }
.ct-ask-no { min-height: 44px; padding: 0 16px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--bg); font: 600 15px/1 var(--f-body); color: var(--ink); cursor: pointer; }

/* body: question column + side column */
.ct-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.ct-main { min-width: 0; padding: var(--s3, 21px) 18px 0; min-height: 420px; display: flex; flex-direction: column; }
.ct-main .pq-list { flex: 1; }
.ct .pq-item { background: none; border: 0; box-shadow: none; padding: 0; margin: 0; }
.ct .pq-item:not(:first-child) { display: none; }          /* no JS: question 1 only */
.ct.is-js .pq-item { display: none; }
.ct.is-js .pq-item.is-cur { display: block; }
.ct .pq-q { margin-bottom: 16px; }
.ct .pq-answer { display: none; }
.ct .pq-answer.is-on { display: block; }
.ct .pq-opt:focus-visible, .ct button:focus-visible, .ct a:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }

/* action row: flag left, prev/next right; sticks to the screen bottom on phone/tablet */
.ct-acts { display: flex; align-items: center; gap: 8px; margin-top: var(--s3, 21px); padding: 12px 0 var(--s3, 21px); border-top: 1px solid var(--line); background: var(--bg); }
.ct-acts[hidden] { display: none; }
.ct-acts .ct-gap { flex: 1; }
.ct-acts button { min-height: 48px; padding: 0 18px; border-radius: var(--r2); font: 700 15px/1 var(--f-body); cursor: pointer; }
.ct-flag, .ct-prev, .ct-score { background: var(--bg); color: var(--ink); border: 1px solid var(--line2); }
.ct-flag:hover, .ct-prev:hover:not(:disabled), .ct-score:hover { border-color: var(--ink2); }
.ct-flag[aria-pressed="true"] { border-color: var(--or); background: var(--ordim); }
.ct-flag[hidden] { display: none; }
.ct-prev:disabled { color: var(--ink2); background: var(--bg2); cursor: default; }
.ct-next { background: var(--or); color: var(--nv); border: 1px solid var(--or); }
.ct-next:hover { background: var(--or2); border-color: var(--or2); }

/* side: grid of 25, running line, finish */
.ct-side { padding: var(--s3, 21px) 18px; border-left: 1px solid var(--line); background: var(--bg2); border-radius: 0 0 var(--r3) 0; }
.ct-side-h { font-family: var(--f-mono); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.ct-nav { display: grid; grid-template-columns: repeat(5, 44px); gap: 6px; margin-top: 10px; }
.ct-nav button { position: relative; width: 44px; height: 44px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--bg);
  font: 600 14px/1 var(--f-mono); color: var(--ink); cursor: pointer; }
.ct-nav button:hover { border-color: var(--ink2); }
/* Universal: 100 questions in four labelled blocks of 25; the grid scrolls inside the side column */
.ct-nav-h { grid-column: 1 / -1; margin: 6px 0 -2px; font-family: var(--f-mono); font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--ink2); }
.ct-nav-h:first-child { margin-top: 0; }
.ct[data-draw="all"] .ct-nav { max-height: 430px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; margin-left: -2px; }
.ct-nav button.is-ans { background: #dde7f5; border-color: #9fb6d8; }
.ct-nav button.is-right { background: var(--gdim); border-color: var(--green); }
.ct-nav button.is-wrong { background: var(--rdim); border-color: var(--red); }
.ct-nav button.is-cur { box-shadow: 0 0 0 2px var(--nv); border-color: var(--nv); }
.ct-nav button.is-flag::after { content: ""; position: absolute; top: -1px; right: -1px; width: 0; height: 0; border-top: 12px solid var(--or); border-left: 12px solid transparent; border-top-right-radius: var(--r); }
.ct-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; font-size: 14px; color: var(--ink2); }
.ct-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -1px; border-radius: 3px; border: 1px solid var(--line2); background: var(--bg); }
.ct-legend .lg-ans { background: #dde7f5; border-color: #9fb6d8; }
.ct-legend .lg-right { background: var(--gdim); border-color: var(--green); }
.ct-legend .lg-wrong { background: var(--rdim); border-color: var(--red); }
.ct-legend .lg-flag { border: 0; background: linear-gradient(225deg, var(--or) 50%, transparent 50%); }
.ct[data-mode="practice"] .lg-ans-k, .ct[data-mode="exam"] .lg-right-k, .ct[data-mode="exam"] .lg-wrong-k { display: none; }
.ct-run { margin-top: 14px; font-size: 15px; font-weight: 600; color: var(--ink); }
.ct-finish { width: 100%; margin-top: 14px; }

/* result + review (states, score, radar, account card) load from /css/ui-core-result.css after first paint;
   the review controls in the static markup stay hidden until then */
.ct-rexit, .ct-rbar, .ct-score, .ct-side-rv { display: none; }


/* below the card: the bank's own heading */
.ct-about { margin-top: var(--s4, 34px); max-width: var(--prose); }
.ct-about h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.618rem); }
.ct-about p { margin-top: 8px; color: var(--ink2); line-height: 1.6; }

/* ── Desktop: question column + side column ── */
@media (min-width: 961px) {
  .ct-body { grid-template-columns: minmax(0, 1fr) 290px; }
  .ct-main { padding: var(--s4, 34px) var(--s4, 34px) 0; min-height: 520px; }
  .ct-acts { padding-bottom: var(--s4, 34px); }
  .ct-side { padding: var(--s4, 34px) 22px; }
}
/* ── Phone/tablet: grid in a drawer, action row sticks to the bottom ── */
@media (max-width: 960px) {
  .ct-gridbtn { display: inline-flex; align-items: center; gap: 6px; }
  .ct-side { display: none; order: -1; border-left: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .ct.is-drawer .ct-side { display: block; }
  .ct-finish-desk { display: none; }
  .ct-acts { position: sticky; bottom: 0; z-index: 5; margin-left: -18px; margin-right: -18px; padding: 10px 18px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 16px -10px rgba(15,31,61,.25); }
  .ct-acts .ct-next { flex: 1.4; }
  .ct-acts .ct-gap { display: none; }
  .ct-acts .ct-flag, .ct-acts .ct-prev { flex: 1; padding: 0 10px; }
  .ct-mode-hint { display: none; }
}
@media (max-width: 600px) {
  /* one question per screen: breadcrumb kept for crawlers (and its JSON-LD), one 44px row for mode + grid, tighter options */
  .ct-top .breadcrumb { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ct-subbar { min-height: 44px; padding: 0 4px 0 2px; }
  .ct-mode { padding: 0; gap: 0; background: none; }
  .ct-mode button, .ct-mode button[aria-pressed="true"] { min-height: 44px; padding: 0 12px; border-radius: 0; background: none; box-shadow: none; }
  .ct-mode button[aria-pressed="true"] { box-shadow: inset 0 -3px 0 var(--nv); }
  .ct-gridbtn { min-height: 44px; padding: 0 10px; border: 0; background: none; }
  .ct .pq-q { margin-bottom: 12px; }
  .ct .pq-opt { min-height: 48px; padding-top: 7px; padding-bottom: 7px; gap: 12px; }
  .ct .pq-opt::before { flex-basis: 28px; width: 28px; height: 28px; }
  .ct .pq-opts { gap: 8px; }
  .ct .pq-item > .pq-opt + .pq-opt { margin-top: 8px; }
  .ct-acts { margin-top: 14px; }
  .ct-bar .qc-dots, .ct-pos-k, .ct-tm-x { display: none; }
  .ct-bar { padding-left: 14px; }
  .ct-main { padding: 16px 14px 0; min-height: 380px; }
  .ct-acts { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .ct-side { padding: 16px 14px; }
  .ct-ask { padding: 12px 14px; }
}

/* short phones (360x740 and below): long stems with long options still fit above the action row */
@media (max-width: 600px) and (max-height: 760px) {
  .ct .pq-q { font-size: 1rem; line-height: 1.4; margin-bottom: 10px; }
  .ct .pq-opt { line-height: 1.35; padding-top: 6px; padding-bottom: 6px; }
  .ct .pq-opts { gap: 6px; }
  .ct .pq-item > .pq-opt + .pq-opt { margin-top: 6px; }
  .ct-main { padding-top: 12px; }
}
@media (max-width: 360px) {
  .ct-top { padding-top: 13px; }
  .ct-top h1 { font-size: 1.6rem; }
  .ct-main { padding-top: 13px; }
  .ct .pq-q { margin-bottom: 12px; }
}

/* ── Source trust strip (same component as Home, ui-home.css) ── */
.tb-b { margin-top: var(--s5, 55px); padding-top: var(--s4, 34px); border-top: 1px solid var(--line); }
.tb-k { font-family: var(--f-mono); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.tb-b ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2, 13px) var(--s3, 21px); margin-top: var(--s2, 13px); }
.tb-b li:last-child { grid-column: 1 / -1; }
.tb-b a { display: flex; flex-direction: column; justify-content: center; min-height: 44px; color: var(--ink2); text-decoration: none; line-height: 1.3; }
.tb-b b { font-family: var(--f-head); font-weight: 700; font-size: 1.125rem; letter-spacing: .01em; transition: color .15s; }
.tb-b span { margin-top: 2px; font-size: 14px; }
.tb-b a:hover b { color: var(--ink); }
.tb-fine { margin-top: var(--s2, 13px); font-size: 14px; color: var(--ink2); }
@media (min-width: 961px) {
  .tb-b ul { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
  .tb-b li:last-child { grid-column: auto; }
  .tb-b li + li { border-left: 1px solid var(--line2); padding-left: var(--s3, 21px); }
  .tb-b li { padding-right: var(--s2, 13px); }
}
@media (max-width: 600px) {
  .tb-b { margin-top: var(--s4, 34px); padding-top: var(--s3, 21px); }
  .tb-k, .tb-fine { line-height: 1.5; }
  .tb-b ul { display: block; margin-top: 6px; line-height: 1.5; }
  .tb-b li { display: inline; }
  .tb-b li + li::before { content: " · "; color: var(--ink2); }
  .tb-b a { display: inline; min-height: 0; }
  .tb-b b { font-size: 1.0625rem; }
  .tb-b span { display: none; }
  .tb-fine { margin-top: 6px; }
}

/* ── Supporting sections under the tool, Home section rhythm ── */
.ct-page .u-sec { padding: var(--s5, 55px) 0; }
@media (min-width: 961px) { .ct-page .u-sec { padding: var(--s6, 89px) 0; } }
.ct-prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ct-page .q-faq { margin-top: 0; }
/* Core topics: a compact definition grid (names link to the study guide) */
.ct-prose .ct-topics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px var(--s4, 34px); margin-top: var(--s3, 21px); }
.ct-topics dt { font-family: var(--f-head); font-weight: 700; font-size: 1.125rem; line-height: 1.3; color: var(--ink); }
.ct-topics dd { margin: 4px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink2); }
.ct-topics dt a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; margin: -10px 0; }
@media (min-width: 768px) { .ct-prose .ct-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; } }
.ct-prose > .q-faq > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ── Below the tool: one tab block (exam questions answered / what this section covers / FAQ).
   Every panel is in the HTML; closed ones are hidden="until-found", so search and #question links reveal them. ── */
.qt-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.qt-tabs [role="tab"] {
  min-height: 44px; padding: 10px 18px; border: 1px solid var(--line2); border-radius: 999px;
  background: var(--bg); color: var(--ink); font: 700 15px/1.2 var(--f-body); cursor: pointer;
}
.qt-tabs [role="tab"]:hover { border-color: var(--ink2); }
.qt-tabs [role="tab"][aria-selected="true"] { background: var(--nv); border-color: var(--nv); color: #fff; }
.qt-tabs [role="tab"]:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.ct-prose > .qt-panel { margin-top: 0; }
.ct-prose .qt-panel > h2:first-child, .ct-prose .qt-panel > .q-faq > h2:first-child { margin-top: 32px; padding-top: 0; border-top: 0; }
.u-prose .qt-panel .qa-more { margin-top: 36px; }
@media (max-width: 480px) { .qt-tabs { gap: 6px; } .qt-tabs [role="tab"] { padding: 8px 11px; font-size: 14px; } }
