/* Thai text: Noto Sans Thai Looped (อักษรมีหัว), the style Thai children learn at school (user's choice, 7 Nov 2026).
   Stored on the Mac mini (public/assets/fonts), so it looks the same on every computer, tablet and phone.
   Used ONLY for Thai characters (unicode-range); English stays in the main font. */
@font-face {
  font-family: "EH Thai";
  src: url("/assets/fonts/noto-sans-thai-looped.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
  size-adjust: 110%;   /* Inter has tall lowercase letters; this keeps Thai text the same visual size as the English */
}
/* English text: Inter (user's choice, 7 Nov 2026), stored on the Mac mini like the Thai font. */
@font-face {
  font-family: "EH Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EH Inter";
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --navy: #3B5398;  /* Education House blue (logo) */
  --navy-dark: #2B3E78;
  --sun: #F6B330;   /* logo yellow-orange */
  --sky: #EAF5FC;
  --ink: #1d2a3a;
  --muted: #5b6b80;
  --line: #d6e2f0;
  --ok: #2E7D4F;    /* logo green */
  --pick: #2E8BC9;  /* logo light blue, a bit deeper */
  --pick-bg: #E4F2FB;
  --radius: 22px;
  --font: "EH Thai", "EH Inter", "Segoe UI", "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #DCEFFA 0%, #F3F9FD 45%, #FFF7EA 100%);
  background-attachment: fixed;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.th { font-family: var(--font); color: var(--muted); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px; background: linear-gradient(90deg, var(--navy), #3F6DB0); color: #fff;
  border-bottom: 4px solid transparent; border-image: linear-gradient(90deg, #60B566, #F6B330 55%, #F18A33) 1;
  box-shadow: 0 2px 10px rgba(20, 50, 90, .18);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: .2px; }
.brand img { width: 42px; height: 42px; background: #fff; border-radius: 12px; padding: 3px; }
.card-logo { display: block; height: 76px; width: auto; max-width: 100%; margin: 0 auto 14px; }
.topinfo { display: flex; align-items: center; gap: 16px; font-size: 16px; font-weight: 600; }
.topinfo .who { background: rgba(255,255,255,.14); padding: 6px 14px; border-radius: 999px; }

main { max-width: 1040px; margin: 0 auto; padding: 22px 20px 20px; }

.card {
  background: #fff; border-radius: var(--radius); padding: 34px;
  box-shadow: 0 10px 30px rgba(31, 78, 140, .10), 0 1px 0 rgba(31,78,140,.05);
}
.center { text-align: center; }
h1 { font-size: 38px; margin: 6px 0 6px; color: var(--navy); }
h2 { font-size: 30px; margin: 4px 0 8px; color: var(--navy); }
.lead { font-size: 22px; margin: 0 0 22px; }
.small { font-size: 14px; color: var(--muted); }

.btn {
  font: inherit; font-weight: 800; font-size: 24px; border: 0; cursor: pointer;
  padding: 16px 38px; border-radius: 999px; background: var(--navy); color: #fff;
  box-shadow: 0 5px 0 var(--navy-dark); transition: transform .06s, box-shadow .06s, opacity .2s;
  display: inline-flex; align-items: center; gap: 10px;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--navy-dark); }
.btn[disabled] { opacity: .35; cursor: default; transform: none; box-shadow: 0 5px 0 var(--navy-dark); }
.btn.sun { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 #D48F1E; }
.btn.ghost { background: #fff; color: var(--navy); box-shadow: 0 0 0 3px var(--line) inset; }
.btn .th { color: inherit; opacity: .8; font-size: .8em; font-weight: 700; }

.login-card { max-width: 760px; margin: 0 auto; }
.welcome { max-width: 720px; margin: 0 auto; }
.who-card { background: var(--sky); border-radius: 20px; padding: 20px 28px; margin: 14px auto 18px; max-width: 520px; text-align: left; }
.who-name { font-size: 32px; font-weight: 800; color: var(--ink); text-align: center; line-height: 1.2; }
.who-th { font-size: 24px; text-align: center; margin-top: 4px; color: var(--ink); }
.who-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-top: 2px solid #D3E8F5; padding: 10px 2px 2px; margin-top: 10px; font-size: 18px; color: var(--muted); }
.who-row b { font-size: 22px; color: var(--navy); text-align: right; }
.field { display: block; text-align: left; margin: 16px auto 0; max-width: 440px; font-size: 20px; font-weight: 700; color: var(--navy); }
.field > span { display: block; margin-bottom: 6px; }
.login-input {
  font: inherit; font-size: 32px; font-weight: 800; letter-spacing: 3px; width: 100%; padding: 12px 18px; border-radius: 16px;
  border: 4px solid var(--line); color: var(--ink); -webkit-user-select: text; user-select: text;
}
.login-input:focus { outline: none; border-color: var(--pick); }
.pw-wrap { position: relative; display: block; }
/* password shown as dots without type=password, so browsers don't offer to save or fill it (shared computers) */
.pin-mask { -webkit-text-security: disc; text-security: disc; }
.pw-wrap .login-input { padding-right: 70px; }
.eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; background: var(--sky); border-radius: 12px; font-size: 24px; width: 50px; height: 50px; cursor: pointer; }
.code-input {
  font: inherit; font-size: 46px; font-weight: 800; letter-spacing: 12px; text-align: center; text-transform: uppercase;
  width: min(420px, 100%); padding: 14px 10px; border-radius: 18px; border: 4px solid var(--line); color: var(--navy);
  -webkit-user-select: text; user-select: text;
}
.code-input:focus { outline: none; border-color: var(--pick); }
.error { color: #c0392b; font-weight: 700; font-size: 18px; min-height: 26px; margin: 12px 0 0; }

.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 18px; }
.name {
  font: inherit; text-align: left; cursor: pointer; background: #fff; border: 3px solid var(--line); border-radius: 18px;
  padding: 14px 16px; transition: border-color .15s, transform .06s;
}
.name:hover { border-color: var(--pick); }
.name:active { transform: scale(.98); }
.name .nick { font-size: 24px; font-weight: 800; color: var(--navy); display: block; }
.name .full { font-size: 15px; color: var(--muted); display: block; margin-top: 2px; }
.name.done { opacity: .45; cursor: default; }
.search {
  font: inherit; font-size: 20px; width: 100%; padding: 12px 18px; border-radius: 14px; border: 3px solid var(--line);
  -webkit-user-select: text; user-select: text;
}

.row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* question screen */
.qhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.section-pill { background: var(--sun); color: var(--ink); font-weight: 800; padding: 8px 18px; border-radius: 999px; font-size: 17px; }
.progress { flex: 1; max-width: 420px; height: 14px; background: #fff; border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 2px var(--line); }
.progress > div { height: 100%; background: linear-gradient(90deg, #4DA5DA, #445FA4); border-radius: 999px; transition: width .4s; }

.qcard { min-height: 470px; display: flex; flex-direction: column; align-items: center; }
.instr { font-size: 17px; color: var(--muted); margin-bottom: 14px; text-align: center; }
.instr b { color: var(--ink); font-weight: 700; }
.prompt { font-size: 32px; font-weight: 700; text-align: center; margin: 6px 0 18px; line-height: 1.35; max-width: 860px; }
.prompt .blank {
  display: inline-block; min-width: 120px; border-bottom: 4px solid var(--navy); margin: 0 6px; color: var(--pick);
  padding: 0 6px; text-align: center;
}
.passage {
  font-size: 22px; line-height: 1.6; background: #fbfdff; border: 2px solid var(--line); border-radius: 18px;
  padding: 18px 24px; max-width: 760px; width: 100%; white-space: pre-line; margin-bottom: 10px;
  -webkit-user-select: text; user-select: text;
}
.stimulus { margin: 4px 0 14px; display: flex; justify-content: center; }
.stimulus .pic, .opt .pic { line-height: 1; }
.stimulus .pic { font-size: 120px; }
.stimulus img { max-width: 360px; max-height: 260px; border-radius: 16px; }

.audio-btn {
  width: 116px; height: 116px; border-radius: 50%; border: 0; cursor: pointer; background: var(--navy); color: #fff;
  box-shadow: 0 6px 0 var(--navy-dark), 0 0 0 10px #DCEFFA; font-size: 46px; display: grid; place-items: center;
  transition: transform .06s;
}
.audio-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--navy-dark), 0 0 0 10px #DCEFFA; }
.audio-btn.playing { animation: pulse 1s infinite; background: var(--pick); }
.audio-btn[disabled] { opacity: .35; cursor: default; }
@keyframes pulse { 50% { box-shadow: 0 6px 0 var(--navy-dark), 0 0 0 18px #DCEFFA; } }
.plays { font-size: 15px; color: var(--muted); margin-top: 10px; text-align: center; }

.options { display: grid; gap: 16px; width: 100%; max-width: 860px; margin-top: 10px; }
.options.pics { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.options.texts { grid-template-columns: 1fr; max-width: 640px; }
.options.yesno { grid-template-columns: 1fr 1fr; max-width: 520px; }
.opt {
  font: inherit; cursor: pointer; background: #fff; border: 4px solid var(--line); border-radius: 20px; color: var(--ink);
  padding: 16px 20px; font-size: 24px; font-weight: 700; transition: border-color .12s, background .12s, transform .06s;
  display: flex; align-items: center; gap: 14px; text-align: left; position: relative;
}
.opt:hover { border-color: #9FCDEB; }
.opt:active { transform: scale(.98); }
.opt.selected { border-color: var(--pick); background: var(--pick-bg); }
.opt.selected::after {
  content: "✓"; position: absolute; top: 8px; right: 12px; background: var(--pick); color: #fff; width: 32px; height: 32px;
  border-radius: 50%; display: grid; place-items: center; font-size: 20px;
}
.options.pics .opt { justify-content: center; flex-direction: column; min-height: 170px; }
.options.pics .opt .pic { font-size: 96px; }
.options.pics .opt img { max-width: 100%; max-height: 150px; border-radius: 10px; }
.options.pics .opt .bigtext { font-size: 72px; font-weight: 800; color: var(--navy); }
.options.yesno .opt { justify-content: center; font-size: 30px; min-height: 90px; }
.opt .letter {
  width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--sky); color: var(--navy);
  display: grid; place-items: center; font-weight: 800; font-size: 19px;
}
.opt.selected .letter { background: var(--pick); color: #fff; }

.next-row { margin-top: auto; padding-top: 24px; display: flex; justify-content: flex-end; width: 100%; }

.big-emoji { font-size: 110px; line-height: 1; margin: 6px 0 4px; }
.feedback { font-size: 26px; font-weight: 800; color: var(--ok); min-height: 36px; margin-top: 14px; }

.offline { position: fixed; inset: 0; background: rgba(15, 35, 60, .45); display: grid; place-items: center; z-index: 50; }
.offline-card { background: #fff; border-radius: 22px; padding: 28px 36px; text-align: center; font-size: 22px; max-width: 420px; }
.spinner { width: 48px; height: 48px; border: 6px solid var(--line); border-top-color: var(--navy); border-radius: 50%; margin: 0 auto 12px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* CEFR reference line – login page only, lower right corner */
.cefr-note { max-width: 680px; margin: 16px auto 0; text-align: center; font-size: 13px; line-height: 1.45; color: var(--muted); }
.cefr-note .th { color: var(--muted); }
@media (max-width: 1100px), (max-height: 760px) {
  .cefr-note { position: static; white-space: normal; max-width: 620px; margin: 18px auto 0; text-align: center; }
}

@media (max-width: 700px) {
  .prompt { font-size: 26px; }
  .card { padding: 22px; }
  h1 { font-size: 30px; }
  .options.pics .opt .pic { font-size: 72px; }
}

/* practice screen: waiting for the teacher to press Start (5 Nov 2026) */
.wait-teacher { font-size: 20px; font-weight: 700; color: var(--navy, #2B3E78); background: #fff8e1; border: 2px dashed #F6B330; border-radius: 14px; padding: 10px 16px; margin: 6px auto 0; max-width: 560px; }

/* ---- question screen fits the window (5 Nov 2026) ---- */
.qbody { display: flex; flex-direction: column; align-items: center; width: 100%; }
.qleft, .qright { display: contents; }              /* narrow screens: everything in one column */
.options.texts.two { grid-template-columns: 1fr 1fr; max-width: 940px; }
@media (max-width: 760px) { .options.texts.two { grid-template-columns: 1fr; } }
.next-row { padding-top: 16px; }
@media (min-width: 900px) {
  main:has(.qcard.side) { max-width: 1280px; }
  .qcard.side .qbody { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
  .qcard.side .qleft, .qcard.side .qright { display: flex; flex-direction: column; align-items: center; min-width: 0; }
  .qcard.side .stimulus { margin: 0; }
  .qcard.side .stimulus img { max-width: 100%; max-height: min(58vh, 460px); }
  .qcard.side .passage { max-width: none; margin: 0; font-size: 20px; line-height: 1.55; max-height: calc(100vh - 250px); overflow: auto; }
  .qcard.side .prompt { font-size: 26px; margin: 0 0 14px; }
  .qcard.side .options.texts { max-width: none; gap: 12px; margin-top: 0; }
  .qcard.side .opt { font-size: 21px; padding: 12px 16px; }
}
@media (max-height: 820px) {
  .card { padding: 24px 30px; }
  .qcard { min-height: 0; }
  .instr { margin-bottom: 8px; }
  .prompt { font-size: 27px; margin: 4px 0 12px; }
  .opt { padding: 12px 18px; font-size: 22px; }
  .options { gap: 12px; }
  .stimulus img { max-height: 220px; }
  .audio-btn { width: 96px; height: 96px; font-size: 38px; }
}
.qcard:has(.options.pics) .prompt { font-size: 34px; }   /* young learners: the word to match stays big */

/* note shown when a student presses the browser's Back button during the test (5 Nov 2026) */
.backnote { position: fixed; left: 50%; top: 84px; transform: translate(-50%, -20px); z-index: 60; opacity: 0; pointer-events: none;
  background: #fff8e1; border: 3px solid var(--sun); border-radius: 18px; padding: 14px 22px; font-size: 20px; font-weight: 700;
  color: var(--ink); text-align: center; box-shadow: 0 10px 30px rgba(31, 78, 140, .18); transition: opacity .2s, transform .2s; max-width: 92vw; }
.backnote.show { opacity: 1; transform: translate(-50%, 0); }

/* copyright line on every student page (5 Nov 2026) – small, quiet, in the normal flow so it never covers Next */
.sitefoot { text-align: center; font-size: 12px; line-height: 1.4; color: var(--muted); opacity: .85; padding: 2px 16px 12px; }
body { display: flex; flex-direction: column; min-height: 100%; }
main { flex: 1 0 auto; width: 100%; }
.topbar, .sitefoot { flex: none; }
.qcode { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); opacity: .8; letter-spacing: .5px; }  /* question code for teachers */

/* ---------- Writing part (5 Nov 2026): tiles and a short typed answer ---------- */
.build {
  min-height: 78px; width: 100%; max-width: 760px; margin: 4px 0 16px; padding: 10px 12px;
  border: 3px dashed #9FCDEB; border-radius: 18px; background: var(--pick-bg);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center;
}
.build.letters { gap: 6px; }
.build-hint { font-size: 16px; color: var(--muted); }
.tiles { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 760px; margin-bottom: 6px; }
.tile {
  font: inherit; font-weight: 800; font-size: 28px; cursor: pointer; background: #fff; color: var(--ink);
  border: 3px solid var(--line); border-radius: 14px; padding: 10px 18px; min-width: 58px;
  box-shadow: 0 4px 0 var(--line); transition: transform .06s, opacity .15s;
}
.tiles.letters .tile, .build.letters .tile { min-width: 58px; padding: 10px 0; text-transform: none; }
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.tile.used { opacity: .25; cursor: default; box-shadow: none; }
.tile.placed { border-color: var(--pick); background: #fff; box-shadow: 0 4px 0 #9FCDEB; }
.tile-tools { gap: 12px; margin-top: 4px; }
.small-btn { font-size: 17px; padding: 8px 18px; }
.typed {
  font: inherit; font-size: 32px; font-weight: 700; text-align: center; width: 100%; max-width: 520px;
  padding: 14px 18px; border: 4px solid var(--line); border-radius: 18px; color: var(--ink); background: #fff; margin: 6px 0 10px;
}
.typed:focus { outline: none; border-color: var(--pick); background: var(--pick-bg); }

/* ---------- Speaking part (5 Nov 2026): microphone ---------- */
.mic-btn {
  width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer; background: var(--ok); color: #fff;
  font-size: 42px; display: grid; place-items: center; box-shadow: 0 6px 0 #1f5a38, 0 0 0 10px #DDF1E5; transition: transform .06s;
}
.mic-btn.big { width: 120px; height: 120px; font-size: 52px; }
.mic-btn:active { transform: translateY(4px); }
.mic-btn.recording { background: #d9483b; box-shadow: 0 6px 0 #9c2f26, 0 0 0 10px #F9DEDB; animation: pulse-red 1s infinite; }
.mic-btn[disabled] { opacity: .4; cursor: default; }
.mic-btn[hidden] { display: none; }
@keyframes pulse-red { 50% { box-shadow: 0 6px 0 #9c2f26, 0 0 0 18px #F9DEDB; } }
.meter-bar { width: 220px; height: 10px; background: #e8eef5; border-radius: 99px; overflow: hidden; margin: 14px auto 4px; }
.meter-bar > div { height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.speak-box { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 640px; }
.speak-msg { font-size: 21px; text-align: center; margin: 8px 0 4px; min-height: 2.6em; }
.speak-msg .small { font-size: 15px; }
.speak-tools { margin-top: 6px; gap: 12px; }
.miccheck { border-top: 2px dashed var(--line); margin-top: 14px; padding-top: 10px; width: 100%; display: flex; flex-direction: column; align-items: center; }

/* Top bar: test name next to Education House (7 Nov 2026). Hidden on narrow phones so the name and timer still fit. */
.brand .brand-sub { font-weight: 600; font-size: 16px; opacity: .9; border-left: 1px solid rgba(255,255,255,.45); padding-left: 12px; margin-left: 2px; white-space: nowrap; }
@media (max-width: 900px) { .brand .brand-sub { display: none; } }
@media (max-width: 520px) { .brand { font-size: 16px; line-height: 1.15; } .brand img { width: 36px; height: 36px; } }
/* Login page without the "Welcome!" heading (7 Nov 2026): a clear gap between the logo and the first text */
/* Login page spacing (7 Nov 2026): one 8-pixel spacing scale, more room under the logo, fields grouped with their labels */
.login-card { max-width: 600px; padding: 44px 56px 40px; }
.login-card .card-logo { height: 72px; margin: 0 auto 40px; }
.login-card .lead { font-size: 21px; line-height: 1.45; margin: 0 0 32px; }
.login-card .field { margin-top: 24px; max-width: 420px; }
.login-card form .field:first-child { margin-top: 0; }
.login-card .field > span { margin-bottom: 8px; }
.login-card .error { font-size: 17px; min-height: 24px; margin: 12px auto 0; max-width: 420px; }
.login-card .row { margin-top: 16px; }
@media (max-height: 820px) {   /* small laptop screens: same rhythm, a little tighter, so nothing needs scrolling */
  .login-card { padding: 32px 48px 30px; }
  .login-card .card-logo { height: 64px; margin-bottom: 32px; }
  .login-card .lead { margin-bottom: 24px; }
  .login-card .field { margin-top: 18px; }
}

/* ======================================================================================
   Icons and "liquid glass" look (7 Nov 2026). Icons are our own line drawings (public/icons.js),
   shown plain next to text, or on a glass tile for the big icons and the part labels.
   ====================================================================================== */
.ico { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.14em; }
.ico .f { fill: currentColor; stroke: none; }
.ico.inl { width: 1.05em; height: 1.05em; color: var(--navy); vertical-align: -0.18em; }
.btn .ico.arr { width: .95em; height: .95em; stroke-width: 2.6; }
.small-btn .ico { stroke-width: 2.3; }

/* glass tile: tinted glass with a bright top edge, a soft inner shine and a coloured glow underneath */
.gl {
  --a: #6E8BE0; --b: #2B3F86;
  position: relative; display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; border-radius: 30%;
  color: #fff; vertical-align: -0.28em; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(120% 85% at 28% -8%, rgba(255,255,255,.78) 0%, rgba(255,255,255,.18) 42%, rgba(255,255,255,0) 60%),
    linear-gradient(160deg, var(--a) 0%, var(--b) 100%);
  box-shadow:
    inset 0 .035em .02em rgba(255,255,255,.95),
    inset 0 -.05em .1em rgba(0,0,0,.16),
    inset 0 0 0 .018em rgba(255,255,255,.5),
    0 .1em .28em -.06em color-mix(in srgb, var(--b) 70%, transparent);
}
.gl::after {   /* light caught by the lower edge, like thick glass */
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(90% 40% at 70% 108%, rgba(255,255,255,.45), rgba(255,255,255,0) 70%);
}
.gl .ico { width: 58%; height: 58%; stroke-width: 2.1; filter: drop-shadow(0 .03em .03em rgba(0,0,0,.28)); vertical-align: 0; }
.gl-blue   { --a: #7D9BEC; --b: #2B3F86; }
.gl-sky    { --a: #7FD0FA; --b: #1F78C4; }
.gl-green  { --a: #8FE09A; --b: #2F8A44; }
.gl-orange { --a: #FFC07A; --b: #E06A1B; }
.gl-gold   { --a: #FFE08A; --b: #D99413; }
.gl-red    { --a: #FF9C8F; --b: #C9372B; }
.gl.mini { font-size: .95em; vertical-align: -0.22em; }

.big-icon { font-size: 92px; line-height: 1; margin: 8px 0 10px; }
.big-icon .gl { vertical-align: 0; }
.section-pill .gl { font-size: 1.35em; margin-right: 4px; vertical-align: -0.3em; }
.topinfo .who .ico { margin-right: 4px; }
.backnote .ico, .wait-teacher .ico { color: var(--navy); }

/* selected answer: glass tick */
.opt.selected::after {
  content: ""; width: 34px; height: 34px; border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-8.5'/%3E%3C/svg%3E") center / 62% no-repeat,
    radial-gradient(120% 85% at 28% -8%, rgba(255,255,255,.7), rgba(255,255,255,0) 58%),
    linear-gradient(160deg, #7FD0FA, #1F78C4);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.9), inset 0 -2px 4px rgba(0,0,0,.15), 0 3px 8px -2px rgba(31,120,196,.6);
}

/* round play and microphone buttons in glass */
.audio-btn, .mic-btn {
  --a: #7D9BEC; --b: #2B3F86; position: relative; color: #fff;
  background:
    radial-gradient(120% 85% at 30% -10%, rgba(255,255,255,.75) 0%, rgba(255,255,255,.15) 45%, rgba(255,255,255,0) 62%),
    linear-gradient(160deg, var(--a), var(--b));
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.9), inset 0 -4px 10px rgba(0,0,0,.18), inset 0 0 0 1.5px rgba(255,255,255,.45),
    0 10px 22px -8px var(--b), 0 0 0 10px color-mix(in srgb, var(--a) 22%, transparent);
  transition: transform .08s;
}
.audio-btn .ico, .mic-btn .ico { width: 46%; height: 46%; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.audio-btn .ico { margin-left: 6%; }
.audio-btn:active, .mic-btn:active { transform: scale(.95); box-shadow: inset 0 2px 1px rgba(255,255,255,.9), inset 0 -4px 10px rgba(0,0,0,.2), 0 4px 10px -6px var(--b), 0 0 0 10px color-mix(in srgb, var(--a) 22%, transparent); }
.audio-btn.playing { --a: #7FD0FA; --b: #1F78C4; animation: glasspulse 1s infinite; }
.mic-btn { --a: #8FE09A; --b: #2F8A44; }
.mic-btn.recording { --a: #FF9C8F; --b: #C9372B; animation: glasspulse 1s infinite; }
@keyframes glasspulse { 50% { box-shadow: inset 0 2px 1px rgba(255,255,255,.9), inset 0 -4px 10px rgba(0,0,0,.18), 0 10px 22px -8px var(--b), 0 0 0 18px color-mix(in srgb, var(--a) 26%, transparent); } }
.meter-bar > div { background: linear-gradient(90deg, #8FE09A, #2F8A44); }

/* ---------- header in liquid glass: a floating frosted-glass bar ---------- */
body {
  background:
    radial-gradient(520px 260px at 8% -40px, rgba(96,181,102,.30), transparent 70%),
    radial-gradient(560px 280px at 52% -80px, rgba(46,139,201,.30), transparent 70%),
    radial-gradient(520px 260px at 96% -40px, rgba(241,138,51,.26), transparent 70%),
    linear-gradient(180deg, #DCEFFA 0%, #F3F9FD 45%, #FFF7EA 100%);
  background-attachment: fixed;
}
.topbar {
  position: sticky; top: 10px; z-index: 50; margin: 10px 14px 0; padding: 8px 14px 8px 9px; border-radius: 24px;
  color: var(--navy-dark); border: 1px solid rgba(255,255,255,.8); border-image: none;
  background: linear-gradient(180deg, rgba(255,255,255,.74) 0%, rgba(255,255,255,.46) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(185%); backdrop-filter: blur(22px) saturate(185%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.98), inset 0 -1px 0 rgba(59,83,152,.07), inset 0 0 18px rgba(255,255,255,.35),
    0 10px 30px -6px rgba(31,60,120,.20), 0 1px 3px rgba(31,60,120,.08);
}
.topbar::after {   /* the logo colours as a thin line along the bottom of the glass */
  content: ""; position: absolute; left: 22px; right: 22px; bottom: -1px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #60B566, #2E8BC9 40%, #F6B330 70%, #F18A33);
}
.topbar .brand img { box-shadow: 0 2px 8px rgba(31,60,120,.16), inset 0 0 0 1px rgba(255,255,255,.9); }
.topbar .brand > span:first-of-type { color: #488CC8; }   /* the light blue of "Education" in the logo */
.topbar .brand .brand-sub { color: #14234B; border-left-color: rgba(59,83,152,.25); opacity: 1; }
.topinfo .who {
  color: #2B3F86; background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.55));
  border: 1px solid rgba(255,255,255,.95); box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(31,60,120,.10);
}
.backnote { top: 92px; }
.section-pill { display: inline-flex; align-items: center; gap: 8px; }
.section-pill .gl { margin-right: 0; vertical-align: 0; }

/* ---------- buttons in liquid glass (7 Nov 2026) ---------- */
.btn { --a: #7D9BEC; --b: #2B3F86; }
.btn.sun { --a: #FFDA7A; --b: #EE9B1A; }
.btn, .btn.sun {
  position: relative; color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  background:
    radial-gradient(130% 120% at 30% -30%, rgba(255,255,255,.55) 0%, rgba(255,255,255,.10) 45%, rgba(255,255,255,0) 62%),
    linear-gradient(170deg, var(--a) 0%, var(--b) 100%);
  box-shadow:
    inset 0 1.5px 1px rgba(255,255,255,.85), inset 0 -3px 8px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.16),
    0 10px 20px -10px var(--b), 0 2px 5px rgba(20,40,90,.14);
  text-shadow: 0 1px 1px rgba(0,0,0,.18);
  transition: transform .08s, box-shadow .12s, opacity .2s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active, .btn.sun:active { transform: scale(.97); box-shadow: inset 0 1.5px 1px rgba(255,255,255,.85), inset 0 -2px 6px rgba(0,0,0,.2), 0 4px 10px -6px var(--b); }
.btn[disabled], .btn.sun[disabled] { opacity: .38; cursor: default; transform: none; filter: none;
  box-shadow: inset 0 1.5px 1px rgba(255,255,255,.7), inset 0 -3px 8px rgba(0,0,0,.12), 0 2px 5px rgba(20,40,90,.08); }
.btn.sun { color: #3A2806; text-shadow: 0 1px 0 rgba(255,255,255,.45); border-color: rgba(255,255,255,.55); }
.btn.ghost {
  color: var(--navy); text-shadow: none; border: 1px solid rgba(255,255,255,.95);
  background: linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(240,246,253,.75) 100%);
  -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 6px rgba(59,83,152,.08), 0 0 0 1.5px rgba(59,83,152,.16), 0 8px 16px -8px rgba(31,60,120,.30);
}
.btn.ghost:active { box-shadow: inset 0 1px 0 #fff, inset 0 -1px 4px rgba(59,83,152,.12), 0 0 0 1.5px rgba(59,83,152,.22), 0 3px 8px -5px rgba(31,60,120,.3); }
@media (max-width: 560px) { .login-card { padding: 28px 20px 26px; } .login-card .card-logo { height: 58px; margin-bottom: 28px; } .login-card .lead { font-size: 18px; } }
/* the logo-colour line under the header fades out at both ends (7 Nov 2026) */
.topbar::after {
  left: 18px; right: 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
}
/* the same fading logo-colour line along the top of the header (7 Nov 2026) */
.topbar::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 3px; border-radius: 3px; pointer-events: none;
  background: linear-gradient(90deg, #60B566, #2E8BC9 40%, #F6B330 70%, #F18A33);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
}

/* ======================================================================================
   Apple Human Interface Guidelines pass (7 Nov 2026). Styling only – nothing about how the test works changes.
   ====================================================================================== */

/* 1. Glass is for controls and navigation (header, buttons) – not for content.
      Content icons become a symbol on a solid coloured rounded square, like the icons in Apple's Settings app. */
.gl {
  background: linear-gradient(180deg, color-mix(in srgb, var(--a) 55%, var(--b)) 0%, var(--b) 100%);
  box-shadow: inset 0 0 0 .012em rgba(255,255,255,.18), 0 .04em .12em rgba(20,40,90,.18);
}
.gl::after { display: none; }
.gl .ico { filter: none; stroke-width: 2; }
.big-icon { font-size: 84px; margin: 4px 0 14px; }
.big-icon .gl { border-radius: 26%; }

/* selected answer: a plain solid tick (state, not decoration) */
.opt.selected::after {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-8.5'/%3E%3C/svg%3E") center / 62% no-repeat,
    var(--pick);
  box-shadow: 0 1px 3px rgba(31,120,196,.35);
}

/* 2. Typography: clear hierarchy with fewer weights; large titles slightly tighter, like Apple's system font */
h1, h2, .prompt { letter-spacing: -0.012em; }
.opt { font-weight: 600; }
.opt .letter { font-weight: 700; }

/* 3. Contrast: small text must reach at least 4.5 : 1 */
.sitefoot { opacity: 1; }
.btn { --a: #6E8CE2; }   /* slightly deeper top of the blue buttons, so white text stays readable on the whole button */

/* 4. Touch targets: everything you can tap is at least 44 × 44 points */
.small-btn { min-height: 44px; padding: 9px 18px; }

/* 5. Keyboard focus is always visible (students who use Tab and Enter) */
.btn:focus-visible, .opt:focus-visible, .tile:focus-visible, .audio-btn:focus-visible, .mic-btn:focus-visible {
  outline: 3px solid var(--pick); outline-offset: 3px;
}
.login-input:focus-visible, .typed:focus-visible { outline: none; }

/* 6. Respect the computer's accessibility settings */
@media (prefers-reduced-motion: reduce) {   /* "Reduce motion": no pulsing or sliding; colours still show playing / recording */
  .fade-in, .audio-btn.playing, .mic-btn.recording { animation: none !important; }
  .btn, .opt, .tile, .audio-btn, .mic-btn { transition: none; }
  .btn:active, .opt:active, .audio-btn:active, .mic-btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {   /* "Reduce transparency": a solid header instead of glass */
  .topbar { background: #F4F9FE; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .btn.ghost { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
}
@media (prefers-contrast: more) {   /* "Increase contrast": stronger borders and text */
  .opt, .tile, .login-input, .typed { border-color: #8FA3BF; }
  .th, .small, .sitefoot, .cefr-note { color: #3E4C5F; }
}

/* ======================================================================================
   Phones (7 Nov 2026). Computers are not affected: everything below only applies to narrow screens
   or a phone turned sideways. No shrink-to-fit on phones (test.js) – the page scrolls normally, text stays
   readable, and the Next button stays at the bottom of the screen, like the main button in a phone app.
   ====================================================================================== */
button, .opt, .tile { touch-action: manipulation; }   /* no double-tap zoom on buttons; pinch zoom still works */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  main { padding: 12px 12px 8px; }
  .card { padding: 20px 16px; border-radius: 20px; }
  .qcard { min-height: 0; }
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  .lead { font-size: 19px; margin-bottom: 16px; }
  .instr { font-size: 15px; margin-bottom: 10px; }
  .prompt { font-size: 24px; margin: 4px 0 14px; }
  .qcard:has(.options.pics) .prompt { font-size: 28px; }
  .options { gap: 10px; margin-top: 4px; }
  .opt { font-size: 20px; padding: 12px 14px; border-width: 3px; border-radius: 16px; gap: 12px; min-height: 56px; }
  .opt .letter { width: 34px; height: 34px; font-size: 17px; }
  .opt.selected::after { width: 28px; height: 28px; top: 6px; right: 8px; }
  .options.pics { grid-template-columns: 1fr 1fr; }
  .options.pics .opt { min-height: 120px; padding: 10px; }
  .options.pics .opt img { max-height: 120px; }
  .options.pics .opt .pic { font-size: 60px; }
  .options.pics .opt .bigtext { font-size: 56px; }
  .passage { font-size: 18px; line-height: 1.55; padding: 14px 16px; }
  .stimulus img { max-width: 100%; max-height: 240px; }
  .audio-btn { width: 88px; height: 88px; }
  .mic-btn.big { width: 104px; height: 104px; }
  .tiles { gap: 8px; }
  .tile { font-size: 24px; min-width: 50px; padding: 8px 12px; }
  .tiles.letters .tile, .build.letters .tile { min-width: 46px; }
  .build { min-height: 64px; }
  .typed { font-size: 26px; }
  .big-icon { font-size: 68px; margin-bottom: 10px; }
  .qhead { gap: 8px; margin-bottom: 10px; }
  /* Next always reachable: it sticks to the bottom of the screen while the question scrolls */
  .next-row, .card > .row:last-child, .login-card form .row {
    position: sticky; bottom: 0; z-index: 20; width: calc(100% + 32px); margin: 8px -16px -20px; padding: 16px 16px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.94) 28%, #fff 100%); border-radius: 0 0 20px 20px;
  }
  .next-row .btn { width: 100%; justify-content: center; }
  /* two buttons (e.g. No / Yes): stacked full width, the main one on top */
  .card > .row:last-child, .login-card form .row { flex-direction: column-reverse; flex-wrap: nowrap; gap: 10px; align-items: stretch; }
  .card > .row:last-child .btn, .login-card form .row .btn { justify-content: center; white-space: nowrap; }
  .feedback { font-size: 19px; }
  .options.pics:has(> .opt:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }   /* practice: three pictures in one row */
  .options.pics:has(> .opt:nth-child(3):last-child) .opt { min-height: 96px; }
}
@media (max-height: 500px) and (pointer: coarse) {   /* phone turned sideways: save height */
  .topbar { position: relative; top: 0; margin: 6px 10px 0; padding: 4px 10px 4px 6px; }
  .brand img { width: 30px; height: 30px; }
  .options.pics { grid-template-columns: repeat(4, 1fr); }
  .options.pics .opt { min-height: 96px; }
  .options.pics .opt img { max-height: 88px; }
  .options.pics .opt .pic { font-size: 48px; }
  .audio-btn { width: 72px; height: 72px; }
  .mic-btn.big { width: 88px; height: 88px; }
  .big-icon { font-size: 52px; }
  .stimulus img { max-height: 180px; }
  .next-row .btn { width: auto; min-width: 50%; }
  .card > .row:last-child, .login-card form .row { flex-direction: row; justify-content: center; }
  .card > .row:last-child .btn, .login-card form .row .btn { min-width: 40%; }
}

/* Practice screen on wide, low screens (sideways tablets, small laptops – 7 Nov 2026): the microphone check sits beside
   the listening practice instead of below it, so the screen fits at full size. Elsewhere the wrappers change nothing. */
.prac-grid, .prac-main { display: contents; }
@media (min-width: 900px) and (max-height: 900px) {
  .practice .prac-grid:has(.miccheck) { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; width: 100%; align-items: center; margin-top: 4px; }
  .practice .prac-grid:has(.miccheck) .prac-main { display: flex; flex-direction: column; align-items: center; }
  .practice .prac-grid .miccheck { border-top: 0; border-left: 2px dashed var(--line); margin: 0; padding: 8px 0 8px 28px; align-self: stretch; justify-content: center; }
  .practice .prac-grid .options.pics { max-width: 520px !important; }
}

/* Details at first login (orders for several tests) */
.details-card select.login-input { width: 100%; background: #fff; font-family: inherit; font-size: 18px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.consent { display: flex; gap: 12px; align-items: flex-start; text-align: left; margin: 22px auto 0; max-width: 420px; font-size: 15px; line-height: 1.45; -webkit-user-select: text; user-select: text; }
.consent input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
