/* Online Test (Great Testing) — 25 Oct 2026. Every colour is an existing token
   from app-ab.css / tokens.css so the pages sit inside the 4AB look; only the
   runner's own vocabulary (palette, timer, option cards) is new. Phone first. */

.ot-wrap { max-width: var(--wrap, 1180px); margin: 0 auto; padding: 0 16px 40px; }
.ot-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .ot-grid--2 { grid-template-columns: 1fr 1fr; } .ot-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.ot-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius, 16px); padding: 18px; box-shadow: var(--shadow-soft, none); }
.ot-card h2, .ot-card h3 { margin: 0 0 10px; font-family: var(--font-display); color: var(--ink); }
.ot-card h2 { font-size: 20px; } .ot-card h3 { font-size: 16px; }
.ot-muted { color: var(--muted); font-size: 13px; }
.ot-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ot-spread { justify-content: space-between; }
.ot-stack { display: grid; gap: 10px; }
.ot-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); margin: 0 0 4px; }

/* inputs */
.ot-field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--body); }
.ot-field input, .ot-field select, .ot-field textarea {
  font: inherit; font-weight: 400; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm, 10px); background: var(--card); color: var(--ink); min-height: 44px; width: 100%; box-sizing: border-box;
}
.ot-field textarea { min-height: 90px; resize: vertical; }
.ot-field input:focus, .ot-field select:focus, .ot-field textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.ot-code-input { font-family: var(--font-mono, monospace); font-size: 24px !important; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.ot-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 500; cursor: pointer; }
.ot-check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--navy); }

/* buttons */
.ot-btn { font: inherit; font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--navy);
  background: var(--navy); color: var(--on-navy, #fff); cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; justify-content: center; text-decoration: none; }
.ot-btn:hover { filter: brightness(1.08); }
.ot-btn[disabled] { opacity: .5; cursor: not-allowed; }
.ot-btn--ghost { background: var(--card); color: var(--navy); }
.ot-btn--gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.ot-btn--danger { background: var(--red); border-color: var(--red); color: #fff; }
.ot-btn--sm { padding: 6px 12px; min-height: 34px; font-size: 13px; }
.ot-btn--block { width: 100%; }

/* pills + tables */
.ot-pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.ot-pill--ok { color: var(--green-ink, var(--green)); border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.ot-pill--warn { color: var(--amber); border-color: var(--amber); }
.ot-pill--bad { color: var(--red); border-color: var(--red); }
.ot-pill--navy { color: var(--on-navy, #fff); background: var(--navy); border-color: var(--navy); }
.ot-table-wrap { overflow-x: auto; }
table.ot-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ot-table th, table.ot-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-2, var(--line)); vertical-align: top; }
table.ot-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
table.ot-table td.num { text-align: right; font-family: var(--font-mono, monospace); white-space: nowrap; }
table.ot-table tr:hover td { background: color-mix(in srgb, var(--navy) 4%, transparent); }

/* stat tiles */
.ot-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .ot-stats { grid-template-columns: repeat(4, 1fr); } .ot-stats--6 { grid-template-columns: repeat(6, 1fr); } }
.ot-stat { background: var(--card-2, var(--card)); border: 1px solid var(--line); border-radius: var(--r-sm, 10px); padding: 12px 14px; }
.ot-stat b { display: block; font-size: 24px; font-family: var(--font-display); color: var(--ink); line-height: 1.1; }
.ot-stat span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ot-stat--ok b { color: var(--green); } .ot-stat--bad b { color: var(--red); } .ot-stat--gold b { color: var(--gold-ink); }

/* score ring */
.ot-ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.ot-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--card); }
.ot-ring > div { position: relative; text-align: center; }
.ot-ring b { display: block; font-size: 30px; font-family: var(--font-display); color: var(--ink); line-height: 1; }
.ot-ring small { color: var(--muted); font-weight: 600; }

/* bars */
.ot-bar { display: grid; grid-template-columns: minmax(90px, 1fr) 3fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.ot-bar .ot-bar__track { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ot-bar .ot-bar__fill { height: 100%; background: var(--green); border-radius: 999px; }
.ot-bar .ot-bar__fill--bad { background: var(--red); }
.ot-bar .ot-bar__fill--mid { background: var(--amber); }

/* steps (create wizard) */
.ot-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.ot-step { flex: 1 1 120px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--card); text-align: center; cursor: pointer; }
.ot-step[aria-current="step"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy, #fff); }
.ot-step--done { color: var(--green); border-color: var(--green); }

/* question picker */
.ot-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ot-qlist { display: grid; gap: 8px; max-height: 520px; overflow: auto; padding-right: 4px; }
.ot-q { border: 1px solid var(--line); border-radius: var(--r-sm, 10px); padding: 10px 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; font-size: 14px; background: var(--card); }
.ot-q--picked { border-color: var(--green); background: color-mix(in srgb, var(--green) 6%, var(--card)); }
.ot-q__meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.ot-q__stem { white-space: pre-wrap; word-break: break-word; }
.ot-picked-bar { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; z-index: 2; }
.ot-opt-edit { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; margin: 4px 0; }
.ot-opt-edit b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--chip-bg); font-size: 12px; }

/* share box */
.ot-share { text-align: center; }
.ot-share .ot-bigcode { font-family: var(--font-mono, monospace); font-size: 40px; letter-spacing: .25em; font-weight: 700; color: var(--navy); margin: 8px 0; }
.ot-share #otQr { display: grid; place-items: center; margin: 10px auto; }
.ot-share input { width: 100%; }

/* ---------------------------------------------------------------- runner */
body.ot-runner { background: var(--page-bg, var(--body-bg)); }
.ot-top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: var(--on-navy, #fff); padding: 10px 14px; display: flex; align-items: center; gap: 12px; }
.ot-top__title { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-timer { font-family: var(--font-mono, monospace); font-size: 20px; font-weight: 700; background: rgba(255,255,255,.14); padding: 4px 12px; border-radius: 999px; }
.ot-timer--low { background: var(--red); color: #fff; animation: ot-blink 1s steps(2) infinite; }
@keyframes ot-blink { 50% { opacity: .55; } }
.ot-top .ot-btn { min-height: 36px; padding: 6px 14px; }
.ot-layout { display: grid; gap: 14px; padding: 14px; max-width: 1180px; margin: 0 auto; }
@media (min-width: 960px) { .ot-layout { grid-template-columns: 1fr 300px; align-items: start; } .ot-side { position: sticky; top: 64px; } }
.ot-secs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.ot-sec { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.ot-sec[aria-selected="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.ot-qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius, 16px); padding: 18px; }
.ot-qhead { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ot-qhead b { font-size: 16px; color: var(--ink); font-family: var(--font-display); }
.ot-stem { font-size: 17px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; word-break: break-word; margin-bottom: 14px; }
.ot-stem img, .ot-opt img { max-width: 100%; height: auto; }
.ot-opts { display: grid; gap: 8px; }
.ot-opt { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-size: 15px; line-height: 1.5; background: var(--card); transition: border-color .12s, background .12s; }
.ot-opt:hover { border-color: var(--navy); }
.ot-opt b { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--body); }
.ot-opt--on { border-color: var(--navy); background: color-mix(in srgb, var(--navy) 7%, var(--card)); }
.ot-opt--on b { background: var(--navy); border-color: var(--navy); color: #fff; }
.ot-opt--correct { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--card)); }
.ot-opt--correct b { background: var(--green); border-color: var(--green); color: #fff; }
.ot-opt--wrong { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--card)); }
.ot-opt--wrong b { background: var(--red); border-color: var(--red); color: #fff; }
.ot-opts--letters { grid-template-columns: repeat(4, 1fr); }
.ot-opts--letters .ot-opt { grid-template-columns: 1fr; justify-items: center; padding: 14px 6px; }
.ot-num input, .ot-sub textarea { font: inherit; font-size: 16px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; width: 100%; box-sizing: border-box; background: var(--card); color: var(--ink); }
.ot-sub textarea { min-height: 140px; }
.ot-qfoot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.ot-qfoot .ot-btn { flex: 1 1 auto; }
.ot-palette { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius, 16px); padding: 14px; }
.ot-pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin: 10px 0; }
.ot-pal { height: 40px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: 13px; cursor: pointer; color: var(--body); position: relative; }
.ot-pal--ans { background: var(--green); border-color: var(--green); color: #fff; }
.ot-pal--seen { background: var(--red); border-color: var(--red); color: #fff; }
.ot-pal--mark { background: var(--navy-2, var(--navy)); border-color: var(--navy); color: #fff; }
.ot-pal--mark.ot-pal--ans::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.ot-pal--cur { outline: 3px solid var(--gold); outline-offset: 1px; }
.ot-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; color: var(--muted); }
.ot-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; border: 1px solid var(--line); }
.ot-pal-sum { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.ot-overlay { position: fixed; inset: 0; background: rgba(10, 20, 40, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.ot-modal { background: var(--card); border-radius: 18px; padding: 22px; max-width: 460px; width: 100%; box-shadow: var(--shadow-lift, 0 20px 60px rgba(0,0,0,.3)); }
.ot-modal h3 { margin: 0 0 8px; font-family: var(--font-display); }
.ot-instr { max-width: 760px; margin: 20px auto; padding: 0 16px; }
.ot-instr ul { padding-left: 20px; line-height: 1.7; }
.ot-rev-expl { margin-top: 12px; border-left: 3px solid var(--gold); padding: 8px 12px; background: color-mix(in srgb, var(--gold) 8%, var(--card)); font-size: 14px; border-radius: 0 10px 10px 0; white-space: pre-wrap; }
.ot-rev-given { font-size: 13px; color: var(--muted); margin-top: 8px; }
.ot-lb-me td { background: color-mix(in srgb, var(--gold) 14%, transparent) !important; font-weight: 700; }
.ot-warn { border: 1px solid var(--amber); color: var(--amber); border-radius: 10px; padding: 10px 12px; font-size: 13px; background: color-mix(in srgb, var(--amber) 8%, var(--card)); }
.ot-empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.ot-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; }
.ot-toast--on { opacity: 1; }
.ot-hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ot-feature { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 14px; }
.ot-feature i { width: 38px; height: 38px; border-radius: 10px; background: var(--chip-bg); display: grid; place-items: center; font-style: normal; font-size: 18px; }
.ot-feature b { display: block; color: var(--ink); }

/* ---- compact pass (owner, 25 Oct: "compact and beautiful") ---- */
.ex-p-otest .ex-hero .ab-hero__panel { padding: 18px 22px; }
.ex-p-otest .ex-hero .ab-hero__title { font-size: 26px; margin: 2px 0 4px; }
.ex-p-otest .ex-hero .ab-hero__lede { font-size: 14px; max-width: 760px; margin: 0; }
.ot-card { padding: 14px 16px; border-radius: 14px; }
.ot-card h2 { font-size: 17px; margin-bottom: 8px; } .ot-card h3 { font-size: 15px; }
.ot-field { font-size: 12px; gap: 4px; }
.ot-field input, .ot-field select, .ot-field textarea { min-height: 38px; padding: 7px 10px; font-size: 14px; border-radius: 9px; }
.ot-field textarea { min-height: 70px; }
.ot-btn { min-height: 38px; padding: 8px 16px; font-size: 13px; }
.ot-btn--sm { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.ot-steps { gap: 4px; margin-bottom: 12px; }
.ot-step { padding: 6px 10px; font-size: 12px; flex-basis: 100px; }
.ot-filters { gap: 8px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.ot-filters select, .ot-filters input { min-height: 36px; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; }
.ot-qlist { gap: 6px; max-height: 440px; }
.ot-q { padding: 8px 10px; gap: 8px; font-size: 13px; line-height: 1.45; border-radius: 9px; }
.ot-q input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); }
.ot-q__stem { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.ot-q__meta { font-size: 12px; margin-top: 3px; gap: 4px; }
.ot-q__meta span { background: var(--chip-bg); border-radius: 999px; padding: 1px 7px; }
.ot-q > .ot-muted { font-size: 12px; font-family: var(--font-mono, monospace); }
.ot-picked-bar { padding: 8px 0; gap: 8px; }
.ot-stack { gap: 8px; }
.ot-stats { gap: 8px; } .ot-stat { padding: 10px 12px; } .ot-stat b { font-size: 20px; }
details.ot-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); font-size: 15px; color: var(--ink); font-weight: 700; }
details.ot-fold > summary::-webkit-details-marker { display: none; }
details.ot-fold > summary::after { content: "+"; font-size: 20px; color: var(--muted); }
details.ot-fold[open] > summary::after { content: "–"; }
details.ot-fold > summary .ot-muted { font-family: var(--font-body, inherit); font-weight: 500; font-size: 12px; margin-left: 10px; }
details.ot-fold > .ot-stack { margin-top: 10px; }
.ot-grid { gap: 12px; }
@media (max-width: 600px) { .ot-step { flex-basis: 30%; } .ot-filters { grid-template-columns: 1fr 1fr; } }
.ot-crop { margin: -4px 0 14px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; overflow: auto; }
.ot-crop img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
/* premium pass 2 (25 Oct, after the walkthrough) */
.ot-crop--thin { display: none; }
.ot-stem--typed { font-size: 13px; color: var(--muted); line-height: 1.45; margin: -6px 0 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.ot-stem--typed::before { content: "Typed text · "; font-weight: 700; letter-spacing: .04em; font-size: 12px; text-transform: uppercase; }
.ot-card--intro { padding: 0; overflow: hidden; }
.ot-card--intro > .ot-band { background: linear-gradient(135deg, #0b1f4b 0%, #1d3a7a 70%, #2b4c96 100%); color: #fff; padding: 20px 22px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.ot-card--intro > .ot-band .ot-kicker { color: #f3d27a; }
.ot-card--intro > .ot-band h2 { color: #fff; font-size: 24px; margin: 2px 0 0; }
.ot-band__sub { margin: 4px 0 0; opacity: .85; font-size: 14px; }
.ot-band__logo { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .9; white-space: nowrap; }
.ot-band__logo img { border-radius: 12px; background: #fff; padding: 4px; }
.ot-card--intro > :not(.ot-band) { margin-left: 22px; margin-right: 22px; }
.ot-card--intro > .ot-stats { margin-top: 16px !important; }
.ot-card--intro > .ot-stack { margin-bottom: 20px; }
.ot-qcard { box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px -16px rgba(16,24,40,.25); }
.ot-opt { transition: border-color .12s, background .12s, transform .08s; }
.ot-opt:active { transform: scale(.995); }
.ot-pal { transition: transform .08s; } .ot-pal:hover { transform: translateY(-1px); }
.ot-timer { letter-spacing: .04em; }
/* Chrome QA 25 Oct: app-ab.css colours every <a> navy, so link-buttons lost their label on the navy fill */
a.ot-btn, a.ot-btn:visited, a.ot-btn:hover { color: var(--on-navy, #fff); text-decoration: none; }
a.ot-btn--ghost, a.ot-btn--ghost:visited, a.ot-btn--ghost:hover { color: var(--navy); }
a.ot-btn--gold, a.ot-btn--gold:visited { color: var(--ink); }

/* ===== responsive pass (25 Oct night, Opus; Sonnet findings in Claude\_reports\online-test-responsive) ===== */
/* laptop / PC: use the width */
@media (min-width: 1100px) {
  .ot-instr { max-width: 920px; }
  .ot-layout { max-width: 1320px; grid-template-columns: 1fr 320px; }
  .ot-stem { font-size: 18px; }
}
@media (min-width: 1600px) {
  .ot-wrap { max-width: 1400px; }
  .ot-layout { max-width: 1480px; grid-template-columns: 1fr 360px; }
}
/* tablet */
@media (min-width: 700px) and (max-width: 959.98px) {
  .ot-layout { grid-template-columns: 1fr; }
  .ot-side { order: -1; }
  .ot-palette { padding: 10px 12px; }
  .ot-pal-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
}
/* phone */
@media (max-width: 699.98px) {
  .ot-btn, .ot-btn--sm, a.ot-btn { min-height: 44px; padding: 10px 16px; font-size: 14px; }
  .ot-field input, .ot-field select, .ot-field textarea, .ot-filters select, .ot-filters input { min-height: 44px; font-size: 16px; }
  .ot-check { font-size: 15px; align-items: center; min-height: 44px; }
  .ot-check input { width: 24px; height: 24px; }
  .ot-instr { padding: 0 12px; margin: 12px auto; }
  .ot-card--intro > .ot-band { padding: 16px; gap: 10px; align-items: flex-start; }
  .ot-card--intro > .ot-band h2 { font-size: 20px; line-height: 1.25; }
  .ot-band__logo span { display: none; }
  .ot-band__logo img { width: 34px; height: 34px; border-radius: 9px; padding: 3px; }
  .ot-card--intro > :not(.ot-band) { margin-left: 14px; margin-right: 14px; }
  .ot-stats { grid-template-columns: repeat(2, 1fr); }
  .ot-stat span, .ot-kicker, .ot-q__meta, .ot-legend, .ot-muted { font-size: 12.5px; }
  /* runner */
  .ot-top { padding: 8px 10px; gap: 8px; }
  .ot-top__title { font-size: 14px; }
  .ot-timer { font-size: 17px; padding: 4px 10px; }
  .ot-layout { padding: 10px; gap: 10px; }
  .ot-qcard { padding: 14px; border-radius: 14px; }
  .ot-stem { font-size: 16px; }
  .ot-opt { min-height: 52px; padding: 12px; align-items: center; }
  .ot-opts--letters { grid-template-columns: repeat(4, 1fr); }
  .ot-qfoot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ot-qfoot #otNext { grid-column: 1 / -1; order: -1; }
  .ot-side { position: static; }
  .ot-pal-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .ot-pal { height: 44px; }
  .ot-crop { padding: 6px; margin-left: -4px; margin-right: -4px; }
  /* hub tables become readable cards */
  table.ot-table { font-size: 13px; }
  .ot-table-wrap { margin: 0 -6px; }
}
/* grid children must be allowed to shrink below the printed crop's natural width (987px crops pushed the
   column past the viewport and body overflow hid the right side: Submit, option D, palette) */
.ot-layout > *, .ot-grid > *, .ot-qcard, .ot-crop { min-width: 0; }
.ot-crop img { max-width: 100% !important; width: auto; height: auto; }
.ot-top { box-sizing: border-box; width: 100%; }
.ot-top .ot-btn { flex: none; }
@media (max-width: 699.98px) { .ot-top .ot-btn { min-height: 44px; } }

/* ===== device pass 2 (25 Oct night): phone portrait (<700) and any short landscape screen (<=500px tall) ===== */
@media (max-width: 699.98px), (max-height: 500px) and (orientation: landscape) {
  /* palette = a sticky one-row strip under the timer bar, always in reach */
  .ot-layout { display: flex; flex-direction: column; }
  .ot-side { order: -1; position: sticky; top: 52px; z-index: 15; }
  .ot-palette { padding: 6px 8px; border-radius: 12px; box-shadow: 0 6px 16px -10px rgba(16,24,40,.35); }
  .ot-palette > .ot-row, .ot-legend { display: none; }
  .ot-pal-grid { display: flex; overflow-x: auto; gap: 6px; margin: 0; padding: 2px; scrollbar-width: none; scroll-behavior: smooth; }
  .ot-pal-grid::-webkit-scrollbar { display: none; }
  .ot-pal { flex: 0 0 44px; height: 40px; }
  .ot-pal-sum { margin-top: 4px; font-size: 12px; gap: 12px; }
  /* typed text under a printed crop: three lines, tap to open */
  .ot-stem--typed { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
  .ot-stem--typed.open { display: block; -webkit-line-clamp: unset; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .ot-top { padding: 4px 12px; }
  .ot-side { top: 46px; }
  .ot-qcard { padding: 12px 14px; }
  .ot-crop img { max-height: 60vh; object-fit: contain; }
  .ot-opts { grid-template-columns: 1fr 1fr; }
  .ot-opts--letters { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 699.98px), (max-height: 500px) and (orientation: landscape) { .ot-pal { height: 44px; } }
@media (min-width: 2200px) {
  .ot-layout { max-width: 1760px; grid-template-columns: 1fr 400px; }
  .ot-wrap { max-width: 1680px; }
  .ot-stem { font-size: 20px; } .ot-opt { font-size: 17px; }
}
/* pages must never run edge-to-edge on very wide screens (result measured 2393px at 2560) */
main.ot-wrap { max-width: 1240px !important; margin-left: auto !important; margin-right: auto !important; width: 100%; box-sizing: border-box; }
@media (min-width: 1600px) { main.ot-wrap { max-width: 1400px !important; } }
@media (min-width: 2200px) { main.ot-wrap { max-width: 1680px !important; } }
/* touch screens of any size (tablets, touch laptops): small buttons still get a finger-sized target */
@media (pointer: coarse) { .ot-btn--sm, a.ot-btn--sm { min-height: 44px; padding: 8px 14px; } .ot-pal { min-height: 44px; } }
