/* Reading and Listening tests: list, test screen, results. */
.t-card .meta b { color: var(--ink); }
.best { color: var(--deep); font-weight: 700; }

/* ---------- test screen ---------- */
body.testing { overflow: hidden; }
body.testing #app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.t-bar { flex: 0 0 auto; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: var(--ink); color: #fff; }
.t-bar .title { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 0; }
@media (max-width: 480px) { .t-bar { padding: 8px 12px; gap: 8px; } .t-bar .clock { font-size: 22px; min-width: 64px; } .t-bar .btn { padding: 0 14px; } }
.t-bar .clock { font-family: var(--serif); font-size: 26px; color: var(--accent); min-width: 80px; text-align: center; }
.t-bar .clock.low { color: #FF9C86; }
.t-bar .btn { min-height: 40px; }

.t-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.t-main { flex: 1 1 auto; min-height: 0; display: flex; }
.t-pane { flex: 1 1 50%; min-width: 0; overflow-y: auto; padding: 24px 28px 40px; }
.t-pane.passage { background: #fff; border-right: 1px solid var(--line); line-height: 1.7; font-size: 17px; }
.t-pane.passage h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.2; margin-bottom: 14px; }
.t-pane.passage p { margin: 0 0 14px; }
.t-pane.passage .plabel { display: block; font-weight: 700; color: var(--primary); }
.t-pane.questions { background: var(--ground); }
.t-tabs { display: none; }

.t-nav { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; overflow-x: auto; padding: 8px 12px; background: #fff; border-top: 1px solid var(--line); }
.t-nav .part { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 12px; flex: 0 0 auto; }
.t-nav .part.on { background: var(--soft); }
.t-nav .part > button { border: 0; background: none; font: 700 14px var(--sans); color: var(--ink); cursor: pointer; padding: 6px 6px; white-space: nowrap; }
.t-nav .nums { display: flex; gap: 3px; }
.t-nav .nums button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line2); background: #fff; font: 600 13px var(--sans); color: var(--ink); cursor: pointer; padding: 0; }
.t-nav .nums button.ans { background: var(--deep); border-color: var(--deep); color: #fff; }

.q-group { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px; }
.q-group h3 { font-size: 17px; }
.q-group .instr { margin-top: 4px; color: var(--ink2); font-size: 15px; }
.q-list { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.q-sub { font-weight: 700; margin-top: 6px; }
.q-row { scroll-margin-top: 16px; }
.q-num { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 26px; padding: 0 6px; border-radius: 7px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; margin-right: 8px; vertical-align: middle; }
.q-row.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: var(--amberbg); } 100% { background: transparent; } }
.gap-in { display: inline-block; width: 170px; max-width: 100%; min-height: 36px; padding: 4px 10px; margin: 2px 4px; border-radius: 8px; border: 1.5px solid var(--line2); font: 500 16px var(--sans); color: var(--ink); background: #fff; vertical-align: middle; }
.gap-in:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line2); background: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.pill:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.mc-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mc-opt { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.mc-opt:has(input:checked) { border-color: var(--primary); background: var(--soft); }
.mc-opt input { margin-top: 4px; accent-color: var(--primary); }
.mc-opt b { min-width: 16px; }
.opt-box { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--ground); display: grid; gap: 4px; font-size: 15px; }
.opt-box div { display: flex; gap: 10px; }
.opt-box b { min-width: 34px; }
.sel { min-height: 36px; padding: 0 8px; border-radius: 8px; border: 1.5px solid var(--line2); font: 600 15px var(--sans); background: #fff; margin-left: 6px; }

.audio-box { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--deep); color: #fff; margin-bottom: 18px; }
.audio-box .st { flex: 1 1 200px; font-weight: 600; }
.audio-box audio { width: 100%; }

.t-start { max-width: 640px; margin: 40px auto; padding: 0 16px; }

@media (max-width: 900px) {
  .t-main { flex-direction: column; }
  .t-tabs { display: flex; gap: 6px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); }
  .t-tabs button { flex: 1; min-height: 40px; border-radius: 10px; border: 1.5px solid var(--line2); background: #fff; font: 700 15px var(--sans); color: var(--ink); }
  .t-tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
  .t-main.split .t-pane { display: none; flex-basis: auto; height: 100%; }
  .t-main.split .t-pane.show { display: block; }
  .t-pane { padding: 18px 16px 32px; }
  .t-pane.passage { border-right: 0; }
}

/* ---------- results ---------- */
.res-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.res-tile { flex: 1 1 160px; padding: 18px 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.res-tile.dark { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.res-tile .k { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.res-tile.dark .k { color: var(--ondark); }
.res-tile .v { font-family: var(--serif); font-size: 42px; line-height: 1.1; }
.res-tile.dark .v { color: var(--accent); }
.review { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.review th { text-align: left; font-size: 13px; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.review td { padding: 10px 8px; border-bottom: 1px solid var(--chip); vertical-align: top; }
.review tr.no td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
.review tr.ok td:first-child { box-shadow: inset 4px 0 0 var(--deep); }
.review .why { margin-top: 4px; padding: 0; background: none; color: var(--ink2); font-size: 14px; }
.mark { font-weight: 700; } .mark.ok { color: var(--deep); } .mark.no { color: var(--danger); }
details.script { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
details.script summary { font-weight: 700; cursor: pointer; }
details.script p { margin: 8px 0 0; font-size: 15px; }
