/* Open tests pages */
.ot-top { background: linear-gradient(180deg, var(--indigo-900, #0b0a24), var(--indigo-800, #140f3a)); color: #fff; }
.ot-in { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ot-logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.ot-logo img { height: 30px; background: #fff; border-radius: 6px; padding: 3px 6px; }
.ot-top nav { display: flex; gap: 14px; align-items: center; }
.ot-top nav a { color: #e6e3ff; text-decoration: none; font-weight: 600; }
.ot-top nav a.ot-login, .ot-top nav a.ot-me { background: rgba(255,255,255,.14); padding: 7px 14px; border-radius: 999px; color: #fff; }
.ot-wrap { max-width: 980px; margin: 0 auto; padding: 20px 16px 50px; }
.ot-wrap h1 { font-size: 1.5rem; margin: 6px 0 6px; }
.ot-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 16px; }
.ot-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line, #e3e0f3); border-radius: 14px; background: #fff; text-decoration: none; color: inherit; box-shadow: 0 6px 20px rgba(20,10,60,.06); }
.ot-card b { font-size: 1.1rem; } .ot-card span { color: var(--muted, #5a5875); line-height: 1.5; } .ot-card em { font-style: normal; font-weight: 700; color: var(--violet, #4b3bd6); margin-top: auto; }
.ot-tabs { display: flex; gap: 6px; margin: 16px 0 12px; flex-wrap: wrap; }
.ot-tabs button { border: 1px solid #d6d2ee; background: #fff; padding: 9px 18px; border-radius: 999px; font-weight: 700; cursor: pointer; min-height: 44px; }
.ot-tabs button.on { background: var(--violet, #4b3bd6); color: #fff; border-color: transparent; }
.ot-today { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px; border-radius: 14px; background: linear-gradient(135deg, #f1efff, #fff8e6); border: 1px solid #e3def9; }
.ot-today h2 { margin: 6px 0 4px; font-size: 1.2rem; } .ot-today p { margin: 2px 0; }
.ot-badge { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: #fff; border: 1px solid #e3def9; padding: 3px 10px; border-radius: 999px; color: var(--violet, #4b3bd6); }
.ot-next { margin: 12px 0 4px; } .ot-hint { background: #fff8e6; border: 1px solid #f5d98f; padding: 8px 12px; border-radius: 8px; font-size: .92rem; }
.ot-month h3 { font-size: 1rem; margin: 20px 0 8px; color: var(--muted, #5a5875); }
.ot-list { display: grid; gap: 8px; }
.ot-item { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line, #e3e0f3); border-radius: 10px; background: #fff; text-decoration: none; color: inherit; }
.ot-item:hover { border-color: #b9b1f0; }
.ot-day { font-weight: 800; color: var(--violet, #4b3bd6); }
.ot-name small { display: block; color: var(--muted, #5a5875); font-size: .82rem; margin-top: 2px; }
.ot-go { font-weight: 700; color: var(--violet, #4b3bd6); } .ot-score { color: #1f8a4c; }
@media (max-width: 560px) { .ot-item { grid-template-columns: 56px 1fr auto; } }
@media (max-width: 700px) {
  .ot-wrap { padding: 16px 16px 24px; }
  .ot-wrap h1 { font-size: 1.3rem; }
  .ot-item { gap: 10px; padding: 12px; min-height: 64px; }
  .ot-name small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ot-pyq .ot-item { grid-template-columns: 1fr auto; }
  .ot-pyq .ot-day { display: none; }
  .ot-today { padding: 16px; }
  .ot-today .btn { width: 100%; }
  .ot-tabs { margin-top: 12px; }
}

/* ---------- practice (practice.js) */
.pr-tabs { display: flex; gap: 4px; background: #eceaf9; padding: 4px; border-radius: 12px; margin: 4px 0 14px; width: max-content; max-width: 100%; }
.pr-tabs a { padding: 8px 14px; border-radius: 9px; font-weight: 700; text-decoration: none; color: var(--muted); white-space: nowrap; font-size: .92rem; }
.pr-tabs a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.pr-src { display: flex; gap: 16px; flex-wrap: wrap; font-size: .92rem; margin: 4px 0 12px; }
.pr-src label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.pr-subj, .pr-diff { display: flex; gap: 6px; margin: 6px 0 12px; }
.pr-subj button, .pr-diff button { border: 1px solid #d6d2ee; background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; cursor: pointer; min-height: 44px; white-space: nowrap; flex: none; }
.pr-subj button.on, .pr-diff button.on { background: var(--indigo-800); border-color: var(--indigo-800); color: #fff; }
.pr-subj small { opacity: .7; font-weight: 600; margin-left: 4px; }
.pr-ch { grid-template-columns: 1fr auto !important; }
.pr-bar { display: block; height: 5px; border-radius: 99px; background: #eceaf9; margin-top: 6px; overflow: hidden; max-width: 220px; }
.pr-bar i { display: block; height: 100%; background: #22a05a; }
.pr-back { margin: 0 0 8px; } .pr-back a { text-decoration: none; font-weight: 700; }
.pr-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 18px; }
.pr-h { font-size: 1.05rem; margin: 18px 0 8px; }
.pr-topic { grid-template-columns: 1fr auto !important; }
.pr-tact { display: flex; gap: 6px; }
.btn.sm { min-height: 44px; padding: 6px 14px; font-size: .88rem; }
/* one question at a time */
.pr-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.pr-qh { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-meta { display: flex; gap: 6px; }
.pr-lvl, .pr-seen { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; background: var(--violet-soft); color: var(--violet); }
.pr-lvl.easy { background: #e6f6ec; color: #0f5e2c; } .pr-lvl.hard { background: var(--red-soft); color: #7c1630; } .pr-lvl.medium { background: var(--amber-soft); color: #7a4b00; }
.pr-seen.c { background: #e6f6ec; color: #0f5e2c; } .pr-seen.w { background: #f1f1f5; color: var(--muted); }
.pr-src-l { font-size: .85rem; color: var(--muted); margin: 6px 0 10px; }
.pr-body, .pr-passage { line-height: 1.6; overflow-x: auto; }
.pr-body img, .pr-passage img, .pr-sol img { max-width: 100%; height: auto; }
.pr-passage { background: #f7f6ff; border-left: 4px solid var(--violet); padding: 10px 12px; border-radius: 6px; margin-bottom: 10px; }
.pr-opts { display: grid; gap: 8px; margin: 14px 0 4px; }
.pr-opts.bare { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pr-opt { display: flex; gap: 10px; align-items: center; text-align: left; padding: 11px 12px; min-height: 48px; border: 1px solid #d6d2ee; border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.pr-opts.bare .pr-opt { justify-content: center; }
.pr-opt.sel { border-color: var(--violet); background: var(--violet-soft); }
.pr-opt.right { border-color: #22a05a; background: #e6f6ec; } .pr-opt.wrong { border-color: #e0526f; background: #fdecf0; }
.pr-num input { display: block; margin-top: 6px; min-height: 46px; font-size: 1.1rem; padding: 8px 12px; border: 1px solid #d6d2ee; border-radius: 10px; width: 220px; max-width: 100%; }
.pr-result { margin: 14px 0 4px; padding: 12px 14px; border-radius: 10px; display: grid; gap: 6px; background: #f6f5fb; border: 1px solid var(--line); }
.pr-result.correct { background: #e6f6ec; border-color: #9ad3b0; } .pr-result.wrong { background: #fdecf0; border-color: #f0a7b7; } .pr-result.partial { background: var(--amber-soft); border-color: #f5d98f; }
.pr-sol { border-top: 1px dashed #c9c5e2; padding-top: 8px; }
.pr-nav { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; margin-top: 16px; }
/* create a test */
.pr-sub { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.pr-sub summary { display: flex; justify-content: space-between; gap: 10px; padding: 13px 14px; cursor: pointer; min-height: 50px; align-items: center; }
.pr-sub > p, .pr-checks { padding: 0 14px; }
.pr-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; padding-bottom: 14px; }
.pr-checks label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: .92rem; }
.pr-checks label.on { border-color: var(--violet); background: var(--violet-soft); }
.pr-checks small { margin-left: auto; color: var(--muted); }
.pr-go { position: sticky; bottom: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: 0 -6px 18px rgba(23,21,59,.08); }
.pr-go p { margin: 0; }
@media (max-width: 860px) { .pr-go { bottom: calc(62px + env(safe-area-inset-bottom)); } }
@media (max-width: 700px) {
  .pr-tabs { width: 100%; } .pr-tabs a { flex: 1; text-align: center; padding: 8px 6px; font-size: .85rem; }
  .pr-card { padding: 12px; margin-inline: -4px; }
  .pr-nav { grid-template-columns: 1fr 1.3fr 1fr; } .pr-nav .btn { padding: 8px 6px; font-size: .9rem; }
  .pr-go .btn { width: 100%; }
}
.ot-tabs.scroll-row, .pr-subj, .pr-diff { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.pr-view { display: flex; gap: 0; border-bottom: 2px solid var(--line); margin: 4px 0 12px; }
.pr-view button { flex: 1; background: none; border: 0; padding: 10px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; min-height: 44px; }
.pr-view button.on { color: var(--violet); border-bottom-color: var(--violet); }
.pr-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.pr-tools input { flex: 1; min-width: 0; min-height: 44px; border: 1px solid #d6d2ee; border-radius: 10px; padding: 8px 12px; font: inherit; background: #fff; }
.pr-tools select { min-height: 44px; border: 1px solid #d6d2ee; border-radius: 10px; padding: 0 10px; background: #fff; font: inherit; }
.pr-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.pr-chip { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--violet-soft); color: var(--violet); }
.pr-chip.gold { background: var(--amber-soft); color: #7a4b00; }
.pr-qs { white-space: nowrap; color: var(--muted); font-size: .88rem; } .pr-qs b { color: var(--ink); }
.pr-stats { margin-bottom: 14px; }

/* tap-to-zoom for question pictures (practice) */
.pr-zoombar { margin: 0 0 6px; font-size: .9rem; }
.pr-zoomwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pr-zoomwrap img { cursor: zoom-in; }
.pr-zoomwrap.on img { width: 170%; max-width: none; height: auto; cursor: zoom-out; }
@media (min-width: 900px) { .pr-zoomwrap.on img { width: 130%; } }

/* retyped questions: text and typeset maths, figures cut at 300 dpi, the printed picture kept under "See it as printed" */
.typed-q p { margin: 0 0 .7em; }
.typed-q table { border-collapse: collapse; margin: .4em 0 .8em; max-width: 100%; }
.typed-q td, .typed-q th { border: 1px solid #b9c0cc; padding: 4px 8px; vertical-align: top; }
.typed-q .nw { white-space: nowrap; }
img.q-fig { display: block; max-width: 100%; height: auto; margin: .4em 0 .8em; }
.opt img.q-fig, .otext img.q-fig, li img.q-fig { margin: 0; }
details.asprinted { margin: .6em 0 0; font-size: .85rem; }
details.asprinted summary { cursor: pointer; color: #1d5fbf; font-weight: 600; width: max-content; padding-block: 11px; }
details.asprinted img { display: block; max-width: 100%; height: auto; margin-top: .5em; border: 1px solid #e3e3ea; border-radius: 6px; }

/* a long displayed formula scrolls sideways on phones instead of being cut off at the edge */
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; -webkit-overflow-scrolling: touch; }
.m-wide { display: block; overflow-x: auto; overflow-y: hidden; max-width: 100%; padding: 2px 0; -webkit-overflow-scrolling: touch; }

/* ---------- page header, breadcrumb, summary and contact bar (server/tests-page.js), matching the website */
.tp-wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
.tp-crumbs { background: var(--bg); border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.tp-crumbs .tp-wrap { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; min-height: 44px; }
.tp-crumbs a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.tp-crumbs a:hover { color: var(--violet); text-decoration: underline; }
.tp-band { position: relative; overflow: hidden; color: #fff; padding-block: clamp(26px, 4vw, 44px);
  background: radial-gradient(1000px 540px at 88% -12%, rgba(108, 92, 231, .55), transparent 62%), radial-gradient(720px 480px at -12% 112%, rgba(255, 197, 61, .16), transparent 60%),
    linear-gradient(135deg, #0b0a24 0%, #140f3a 46%, #2a1f7a 100%); }
.tp-band::after { content: ""; position: absolute; right: -140px; top: -170px; width: 460px; height: 460px; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(169, 156, 255, .22); box-shadow: 0 0 0 60px rgba(169, 156, 255, .04), 0 0 0 130px rgba(169, 156, 255, .03); }
.tp-band .tp-wrap { position: relative; z-index: 1; }
.tp-band h1 { color: #fff; margin: 0 0 8px; max-width: 800px; font-family: var(--font-head); font-weight: 700; font-size: clamp(1.55rem, 3vw, 2.3rem); line-height: 1.12; letter-spacing: -.03em; }
.tp-lead { color: #d6d1f5; margin: 0; max-width: 720px; font-size: 1.02rem; line-height: 1.6; }
.tp-band :focus-visible { outline-color: var(--gold); }
@media (max-width: 700px) { .tp-wrap { padding-inline: 16px; } .tp-lead { font-size: .95rem; } }

/* room for the page while it loads, so the footer and the summary below never jump into view (layout shift) */
.tp-app { min-height: 80vh; min-height: 80svh; }
.tp-hub .tp-app, .tp-hub .pf-site .pf-main { min-height: 0; }   /* the first view already is the whole page */

.tp-sum { background: #fff; border-top: 1px solid var(--line); padding-block: 28px 6px; }
.tp-sum + .tp-sum { border-top: 0; padding-top: 4px; }
.tp-sum h2 { font-size: 1.15rem; margin: 0 0 12px; }
.tp-points { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.tp-points li { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tp-points b { display: block; margin-bottom: 4px; font-family: var(--font-head); font-size: .98rem; }
.tp-points span { color: var(--muted); font-size: .93rem; line-height: 1.55; }

/* Call / WhatsApp / Apply bar on phones and the WhatsApp button on computers, on the tests pages only (never in a test) */
.tp-cta { display: none; }
.wa-ico { width: 1.25em; height: 1.25em; flex: none; }
.mobile-cta a { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 52px; padding: 0 6px; font-weight: 700; font-size: .95rem; text-decoration: none; }
.mobile-cta :focus-visible { outline-color: var(--gold); outline-offset: -4px; }
.mc-call { background: var(--indigo-800); color: #fff; }
.mc-wa { background: #15803d; color: #fff; }
.mc-apply { background: var(--gold); color: var(--indigo-900); }
@media (max-width: 640px) {
  body.tp-landing:not(.pf-has-tabs) .mobile-cta { display: grid; grid-template-columns: 1fr 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: var(--indigo-800); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 18px rgba(0, 0, 0, .12); }
  body.tp-landing:not(.pf-has-tabs) { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  body.nav-open .mobile-cta { display: none !important; }
}
.wa-float { position: fixed; right: 22px; bottom: 22px; z-index: 56; align-items: center; gap: 10px; height: 58px; padding: 0 16px; border-radius: 999px;
  background: #25d366; color: #fff; text-decoration: none; box-shadow: 0 10px 28px rgba(7, 94, 84, .35); transition: transform .2s, box-shadow .2s; }
.wa-float .wa-ico { width: 28px; height: 28px; }
.wa-float .wa-label { max-width: 0; overflow: hidden; white-space: nowrap; font-weight: 700; font-size: .95rem; color: #073b2c; transition: max-width .3s; }
.wa-float:hover, .wa-float:focus-visible { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(7, 94, 84, .45); }
.wa-float:hover .wa-label, .wa-float:focus-visible .wa-label { max-width: 240px; }
.wa-float:focus-visible { outline: 3px solid var(--indigo-800); outline-offset: 3px; }
@media (min-width: 641px) { body.tp-landing:not(.tp-create):not(.nav-open) .wa-float { display: flex; } }
@media (prefers-reduced-motion: reduce) { .wa-float, .wa-float .wa-label { transition: none; } }
/* the sticky "Start the test" bar of "Create a test" sits just above whichever bottom bar the phone shows */
@media (max-width: 860px) { body:not(.pf-has-tabs) .pr-go { bottom: 0; } }
@media (max-width: 640px) { body.tp-landing:not(.pf-has-tabs) .pr-go { bottom: calc(52px + env(safe-area-inset-bottom)); } }

/* tap targets: 44 px for links and buttons, 24 px tick boxes and round buttons */
.pr-tabs a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.pr-back a { display: inline-flex; align-items: center; min-height: 44px; }
.tp-body .btn-link { display: inline-flex; align-items: center; min-height: 44px; }
.pr-src label { min-height: 44px; }
.pr-checks label { min-height: 44px; }
.pr-src input[type="radio"], .pr-checks input[type="checkbox"] { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--violet); }
.ot-hint a { padding-block: 14px; }

/* phones: rows of tabs scroll sideways; the right edge fades so it is clear there is more */
@media (max-width: 700px) {
  .ot-tabs.scroll-row, .pr-subj, .pr-diff { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .ot-tabs.scroll-row::after, .pr-subj::after, .pr-diff::after { content: ""; flex: 0 0 12px; }
}
