/* EDII exam paper tool (js/exam-paper-tool.js). Self-contained: no Bootstrap needed.
   Palette follows the 2026 site: navy #0B1B2E, brand blue #1E56C8, gold #D9A733. */
.ext { --ext-ink: #0B1B2E; --ext-blue: #1E56C8; --ext-gold: #D9A733; --ext-text: #182538; --ext-mut: #5A6880; --ext-line: #DFE4EC; --ext-bg: #FFFFFF; --ext-chalk: #F5F7FB; --ext-red: #C24B33; --ext-green: #1E7B4F;
  font-family: "Figtree", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ext-text); max-width: 880px; margin: 0 auto; }
.ext *, .ext *::before, .ext *::after { box-sizing: border-box; }
/* Reserve the widget's rendered height until js/exam-paper-tool.js fills the mount, so the
   sections below do not jump when it renders (Lighthouse desktop CLS 0.127 on try-ai.html).
   Heights measured on the live form, 14-09-2026. :empty stops matching once it renders. */
#edii-exam-tool:empty { display: block; min-height: 850px; }
@media (max-width: 991px) { #edii-exam-tool:empty { min-height: 960px; } }
@media (max-width: 720px) { #edii-exam-tool:empty { min-height: 1500px; } }
@media (max-width: 400px) { #edii-exam-tool:empty { min-height: 1640px; } }

.ext-card { background: var(--ext-bg); border: 1px solid var(--ext-line); border-radius: 18px; padding: clamp(20px, 3.5vw, 36px); box-shadow: 0 18px 50px rgba(11, 27, 46, .08); }
.ext-h { font-family: "Bricolage Grotesque", "Figtree", system-ui, sans-serif; font-weight: 800; letter-spacing: -.01em; font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.15; margin: 0 0 6px; color: var(--ext-ink); }
.ext-sub { margin: 0 0 18px; color: var(--ext-mut); font-size: 1rem; line-height: 1.5; }
.ext-eyebrow { font-family: "Spline Sans Mono", ui-monospace, monospace; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ext-blue); margin: 0 0 6px; }
.ext-fine { font-size: .82rem; color: var(--ext-mut); margin: 12px 0 0; line-height: 1.45; }
.ext-fine a { color: var(--ext-blue); }

/* tabs */
.ext-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.ext-tab { appearance: none; border: 1px solid var(--ext-line); background: var(--ext-bg); border-radius: 14px; padding: 12px 14px; text-align: left; cursor: pointer; font: inherit; font-weight: 700; color: var(--ext-ink); transition: border-color .15s, box-shadow .15s; }
.ext-tab span { display: block; font-weight: 500; font-size: .82rem; color: var(--ext-mut); margin-top: 2px; }
.ext-tab.on { border-color: var(--ext-blue); box-shadow: 0 0 0 3px rgba(30, 86, 200, .14); }
.ext-tab:focus-visible { outline: 2px solid var(--ext-blue); outline-offset: 2px; }

/* form */
.ext-form label { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--ext-ink); }
.ext-form label small { font-weight: 500; color: var(--ext-mut); }
.ext-form input[type="text"], .ext-form input[type="email"], .ext-form input[type="tel"], .ext-form select { font: inherit; font-size: 1rem; padding: 12px 13px; border: 1px solid var(--ext-line); border-radius: 11px; background: var(--ext-bg); color: var(--ext-text); width: 100%; min-height: 48px; }
.ext-form input:focus, .ext-form select:focus { outline: none; border-color: var(--ext-blue); box-shadow: 0 0 0 3px rgba(30, 86, 200, .14); }
.ext-form input[readonly] { background: var(--ext-chalk); color: var(--ext-mut); }
.ext-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.ext-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ext-full { margin-bottom: 14px; }
.ext-types { border: 0; padding: 0; margin: 4px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.ext-types legend { font-size: .86rem; font-weight: 600; color: var(--ext-ink); margin-bottom: 8px; width: 100%; }
.ext-types legend small { font-weight: 500; color: var(--ext-mut); }
.ext-chip { flex-direction: row !important; align-items: center; gap: 6px !important; border: 1px solid var(--ext-line); border-radius: 100px; padding: 8px 12px; cursor: pointer; font-weight: 500 !important; font-size: .86rem !important; background: var(--ext-bg); user-select: none; }
.ext-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ext-chip em { font-style: normal; font-family: "Spline Sans Mono", ui-monospace, monospace; font-size: .72rem; color: var(--ext-mut); }
.ext-chip.on { border-color: var(--ext-blue); background: rgba(30, 86, 200, .08); color: var(--ext-blue); }
.ext-chip.on em { color: var(--ext-blue); }
.ext-chip:has(input:focus-visible) { outline: 2px solid var(--ext-blue); outline-offset: 2px; }

/* buttons */
.ext-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: 1rem; padding: 14px 24px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; text-decoration: none; min-height: 50px; transition: transform .12s, box-shadow .12s, background .12s; }
.ext-btn-primary { background: var(--ext-blue); color: #fff; box-shadow: 0 10px 26px rgba(30, 86, 200, .28); width: 100%; }
.ext-btn-primary:hover { transform: translateY(-1px); background: #1a4cb3; }
.ext-btn-primary:disabled { opacity: .7; cursor: progress; transform: none; }
.ext-btn-ghost { background: var(--ext-bg); color: var(--ext-ink); border-color: var(--ext-line); }
.ext-btn-ghost:hover { border-color: var(--ext-ink); }
.ext-link { appearance: none; background: none; border: 0; padding: 8px 4px; font: inherit; font-weight: 600; color: var(--ext-blue); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ext-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 8px; }
.ext-actions .ext-btn-primary { width: auto; min-width: 220px; }
.ext-dl { margin: 14px 0 22px; }
.ext-err { background: #fdf1ee; color: var(--ext-red); border: 1px solid #f3cfc6; border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 0 0 12px; }

/* busy */
.ext-busy { text-align: center; padding: 48px 24px; }
.ext-spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(30, 86, 200, .15); border-top-color: var(--ext-blue); margin: 0 auto 18px; animation: ext-spin .9s linear infinite; }
@keyframes ext-spin { to { transform: rotate(360deg); } }

/* paper */
.ext-paperhead { border-bottom: 1px solid var(--ext-line); padding-bottom: 14px; margin-bottom: 8px; }
.ext-meta { margin: 4px 0 10px; color: var(--ext-mut); }
.ext-chapters { margin: -4px 0 10px; font-size: .92rem; color: var(--ext-text); line-height: 1.45; }
.ext-chapters em { font-style: normal; color: var(--ext-mut); }
.ext-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ext-pill { font-family: "Spline Sans Mono", ui-monospace, monospace; font-size: .72rem; letter-spacing: .03em; border: 1px solid rgba(30, 86, 200, .3); color: var(--ext-blue); padding: 4px 10px; border-radius: 100px; }
.ext-qlist { list-style: none; margin: 0; padding: 0; }
.ext-qlist li { display: grid; grid-template-columns: 34px 1fr 36px; gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--ext-line); line-height: 1.5; }
.ext-qn { font-weight: 700; color: var(--ext-ink); }
.ext-qm { font-family: "Spline Sans Mono", ui-monospace, monospace; font-size: .78rem; color: var(--ext-mut); text-align: right; padding-top: 3px; }
.ext-qm::after { content: " m"; }
.ext-blur .ext-qt { filter: blur(5px); user-select: none; color: var(--ext-mut); }
.ext-blur { opacity: .7; }
.ext-opts { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; font-size: .92rem; color: var(--ext-mut); }
.ext-qlist-full { margin-top: 6px; }

/* unlock */
.ext-unlock { margin-top: 18px; background: var(--ext-chalk); border: 1px solid var(--ext-line); border-radius: 14px; padding: clamp(16px, 3vw, 24px); }
.ext-unlock h4 { font-family: "Bricolage Grotesque", "Figtree", system-ui, sans-serif; font-size: 1.15rem; margin: 0 0 4px; color: var(--ext-ink); }
.ext-unlock .ext-form input, .ext-unlock .ext-form select { background: #fff; }
.ext-otp { display: grid; grid-template-columns: minmax(0, 220px) auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.ext-otp input { letter-spacing: .3em; font-family: "Spline Sans Mono", ui-monospace, monospace; font-size: 1.2rem; }

/* done */
.ext-done-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.ext-check { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--ext-green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; }
.ext-next { margin-top: 26px; background: var(--ext-ink); color: #EAF0F9; border-radius: 14px; padding: clamp(18px, 3vw, 26px); }
.ext-next h4 { font-family: "Bricolage Grotesque", "Figtree", system-ui, sans-serif; font-size: 1.2rem; margin: 0 0 6px; color: #fff; }
.ext-next p { margin: 0 0 14px; color: #9DAFC9; line-height: 1.5; }
.ext-next .ext-btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.ext-next .ext-btn-ghost:hover { border-color: #fff; }

@media (max-width: 720px) {
  .ext-grid, .ext-grid-4 { grid-template-columns: 1fr 1fr; }
  .ext-actions .ext-btn-primary { width: 100%; }
  .ext-tabs { grid-template-columns: 1fr; }
  .ext-opts { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .ext-grid, .ext-grid-4 { grid-template-columns: 1fr; }
  .ext-otp { grid-template-columns: 1fr; }
  .ext-qlist li { grid-template-columns: 28px 1fr 32px; }
}
