/* ExamDial — three-ring "watch bezel" question selector.
   Paper/instrument look: cream face, engraved ticks, accent lens at 12 o'clock. */
.ed,
.ed-body {
  --ed-ink:#1f2620;
  --ed-muted:#6f7a72;
  --ed-faint:#a3ad9f;
  --ed-line:#dfe6dc;
  --ed-face:#f6f8f2;
  --ed-face-2:#eaeee3;
  --ed-track:#eef2e9;
  --ed-accent:#3d5a66;
  --ed-accent-ink:#2e4a59;
  --ed-accent-soft:#3d5a661f;
  --ed-ready:#25754b;
  --ed-ready-ink:#1c5c3a;
  --ed-ease:cubic-bezier(.2,.8,.2,1);
}
body.ms-landing .ed,
body.ms-landing .ed-body { --ed-accent:#25754b; --ed-accent-ink:#1c5c3a; --ed-accent-soft:#25754b1f; }

.ed {
  position:relative;
  width:100%;
  max-width:400px;
  margin:0 auto;
  font-family:'Manrope',Arial,sans-serif;
  color:var(--ed-ink);
}
.ed-body {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
  width:100%;
  font-family:'Manrope',Arial,sans-serif;
  color:var(--ed-ink);
}

/* ---------- qualification switch (host-rendered, above the dial) ---------- */
.ed-qualification {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:0 auto 10px;
  font:600 12px/1.2 'Manrope',Arial,sans-serif;
  color:#6f7a72;
}
.ed-qualification select {
  width:auto;
  max-width:100%;
  padding:6px 10px;
  border:1px solid #dfe6dc;
  border-radius:8px;
  background:transparent;
  color:inherit;
  font:inherit;
}

/* ---------- face ---------- */
.ed-face {
  position:relative;
  width:100%;
  max-width:360px;
  aspect-ratio:1;
  user-select:none;
  -webkit-user-select:none;
  -webkit-tap-highlight-color:transparent;
}
.ed-face::before {
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  background:radial-gradient(circle at 38% 30%, #fdfefb 0%, var(--ed-face) 45%, var(--ed-face-2) 100%);
  box-shadow:inset 0 1px 0 #fff, inset 0 -10px 22px #8f9f8018, 0 18px 36px -22px #26322250, 0 0 0 1px var(--ed-line);
}
.ed-svg {
  position:relative;
  display:block;
  width:100%;
  height:100%;
  overflow:visible;
  touch-action:none;
  cursor:grab;
}
.ed-svg:active { cursor:grabbing; }

/* tracks for session + question rings */
.ed-track {
  fill:none;
  stroke:var(--ed-track);
  transition:stroke .25s var(--ed-ease);
}
.ed-track.ed-next { stroke:color-mix(in srgb, var(--ed-accent) 9%, var(--ed-track)); }
.ed-track.ed-focus { stroke:color-mix(in srgb, var(--ed-accent) 11%, var(--ed-track)); }
.ed-track.ed-locked { stroke:#f1f3ee; }
.ed-crown-well { fill:var(--ed-face); stroke:var(--ed-line); stroke-width:1; }

/* lens: the selection window at 12 o'clock */
.ed-lens {
  fill:transparent;
  stroke:var(--ed-faint);
  stroke-width:1;
  stroke-dasharray:3 3;
  pointer-events:none;
  transition:fill .2s, stroke .2s;
}
.ed-lens.ed-lens-on { fill:var(--ed-accent); stroke:var(--ed-accent-ink); stroke-dasharray:none; }
.ed-lens.ed-lens-locked { stroke:transparent; }

.ed-pointer { fill:var(--ed-accent); }

.ed-ring { transition:opacity .25s; }
.ed-ring.ed-locked { opacity:.9; }

/* paper segments */
.ed-seg {
  fill:color-mix(in srgb, var(--seg, #7e97a3) 15%, #fbfcf8);
  stroke:color-mix(in srgb, var(--seg, #7e97a3) 30%, #fff);
  stroke-width:.8;
  transition:fill .25s var(--ed-ease);
}
.ed-ring-paper.ed-next .ed-seg { fill:color-mix(in srgb, var(--seg, #7e97a3) 22%, #fbfcf8); }
.ed-seg:hover { fill:color-mix(in srgb, var(--seg, #7e97a3) 32%, #fbfcf8); }
.ed-seg.ed-on { fill:var(--seg, #7e97a3); stroke:color-mix(in srgb, var(--seg, #7e97a3) 80%, #000); }

.ed-label {
  font-family:'Manrope',Arial,sans-serif;
  fill:var(--ed-ink);
  pointer-events:none;
}
.ed-label-paper { font-size:14.5px; font-weight:800; letter-spacing:.5px; transition:fill .2s; }
.ed-label-paper-sub { font-size:6.6px; font-weight:700; letter-spacing:1.4px; fill:var(--ed-muted); transition:fill .2s; }
.ed-label-paper.ed-on { fill:#fff; }
.ed-label-paper-sub.ed-on { fill:#ffffffd0; }

/* window-ring items */
.ed-item .ed-tick { stroke:var(--ed-faint); stroke-width:1.1; stroke-linecap:round; }
.ed-year-split { stroke:#c9d1c3; stroke-width:1; }
.ed-label-session { font-size:10.5px; font-weight:700; letter-spacing:.2px; fill:var(--ed-ink); }
.ed-label-question { font-size:11.5px; font-weight:800; fill:var(--ed-ink); }
.ed-resit { font-size:7px; font-weight:800; fill:#b0702e; }
.ed-item.ed-in-lens .ed-label { fill:#fff; }
.ed-item.ed-in-lens .ed-resit { fill:#ffe2bf; }
.ed-item.ed-in-lens .ed-tick { stroke:#ffffffaa; }
.ed-placeholder { font-size:8.5px; font-weight:700; letter-spacing:.3px; fill:var(--ed-faint); font-family:'Manrope',Arial,sans-serif; pointer-events:none; }

/* visually hidden keyboard sliders */
.ed-kb {
  position:absolute;
  width:1px; height:1px;
  margin:-1px; padding:0; border:0;
  overflow:hidden;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  white-space:nowrap;
}

/* ---------- crown ---------- */
.ed-crown {
  position:absolute;
  left:50%;
  top:50%;
  width:27.9%;
  aspect-ratio:1;
  transform:translate(-50%,-50%);
  border-radius:50%;
  display:grid;
  place-items:center;
  container-type:inline-size;
  pointer-events:none;
}
.ed-step {
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:2px;
  line-height:1.15;
}
.ed-step[hidden] { display:none; }
.ed-step-num { font-size:clamp(7px,8cqw,9px); font-weight:700; letter-spacing:.8px; text-transform:uppercase; color:var(--ed-muted); }
.ed-step-name { font-size:clamp(12px,15cqw,16px); font-weight:800; color:var(--ed-ink); letter-spacing:-.2px; }
.ed-step-how { font-size:clamp(7px,8cqw,9px); font-weight:600; color:var(--ed-muted); }

.ed-check {
  pointer-events:auto;
  width:100%;
  height:100%;
  border-radius:50%;
  border:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  background:radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--ed-ready) 70%, #fff) 0%, var(--ed-ready) 55%, var(--ed-ready-ink) 100%);
  color:#fff;
  font-family:'Manrope',Arial,sans-serif;
  cursor:pointer;
  box-shadow:0 8px 18px -8px #1c5c3a99, inset 0 1px 0 #ffffff55;
  transition:transform .18s var(--ed-ease), filter .2s;
  animation:ed-check-in .38s var(--ed-ease) both;
}
.ed-check[hidden] { display:none; }
.ed-check:not(.ed-check-ready) { filter:saturate(.55) brightness(1.05); }
.ed-check.ed-check-ready { animation:ed-check-in .38s var(--ed-ease) both, ed-pulse 2s ease-in-out .4s 3; }
.ed-check:hover { transform:scale(1.04); }
.ed-check:active { transform:scale(.95); }
.ed-check:focus-visible { outline:3px solid color-mix(in srgb, var(--ed-ready) 45%, #fff); outline-offset:3px; }
.ed-check-label { font-size:clamp(13px,17cqw,18px); font-weight:800; letter-spacing:.2px; line-height:1; }
.ed-check-sub { display:inline-flex; align-items:center; gap:3px; font-size:clamp(9px,10cqw,11px); font-weight:700; opacity:.9; text-transform:uppercase; letter-spacing:1px; }
@keyframes ed-check-in { from { transform:scale(.6); opacity:0; } to { transform:scale(1); opacity:1; } }
@keyframes ed-pulse { 0%,100% { box-shadow:0 8px 18px -8px #1c5c3a99, 0 0 0 0 #25754b55; } 50% { box-shadow:0 8px 18px -8px #1c5c3a99, 0 0 0 10px #25754b00; } }

/* ---------- summary ---------- */
.ed-summary {
  width:100%;
  max-width:340px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.ed-summary-head {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.9px;
  text-transform:uppercase;
  color:var(--ed-muted);
}
.ed-summary-head > span { margin-right:auto; }
.ed-sound, .ed-close {
  display:inline-flex;
  align-items:center;
  gap:5px;
  height:28px;
  padding:0 10px;
  border:1px solid var(--ed-line);
  border-radius:99px;
  background:#fff;
  color:var(--ed-muted);
  font:700 11px/1 'Manrope',Arial,sans-serif;
  letter-spacing:0;
  text-transform:none;
  cursor:pointer;
  transition:color .2s, border-color .2s;
}
.ed-sound:hover, .ed-close:hover { color:var(--ed-ink); border-color:#c8d2bd; }
.ed-sound .ed-sound-off { display:none; }
.ed-sound.ed-muted .ed-sound-waves { display:none; }
.ed-sound.ed-muted .ed-sound-off { display:inline; }
.ed-close { width:28px; padding:0; justify-content:center; display:none; }
.ed-in-pop .ed-close { display:inline-flex; }

.ed-rows {
  display:flex;
  flex-direction:column;
  border:1px solid var(--ed-line);
  border-radius:14px;
  background:#fff;
  overflow:hidden;
}
.ed-row {
  display:flex;
  align-items:center;
  gap:11px;
  width:100%;
  padding:10px 12px;
  border:0;
  border-top:1px solid var(--ed-line);
  background:transparent;
  color:inherit;
  text-align:left;
  cursor:pointer;
  font-family:inherit;
  transition:background .2s;
}
.ed-row:first-child { border-top:0; }
.ed-row:hover { background:#f7f9f4; }
.ed-row:focus-visible { outline:2px solid var(--ed-accent); outline-offset:-2px; }
.ed-row-dot {
  flex:none;
  width:22px; height:22px;
  border-radius:50%;
  display:grid; place-items:center;
  font-size:10px; font-weight:800;
  color:var(--ed-muted);
  border:1.5px dashed var(--ed-faint);
  transition:background .2s, border-color .2s, color .2s;
}
.ed-row-next .ed-row-dot { border-style:solid; border-color:var(--ed-accent); color:var(--ed-accent); }
.ed-row-set .ed-row-dot { border:0; background:var(--row-dot, var(--ed-accent)); color:transparent; position:relative; }
.ed-row-set .ed-row-dot::after { content:""; position:absolute; width:8px; height:4px; border:2px solid #fff; border-top:0; border-right:0; transform:translateY(-1px) rotate(-45deg); }
.ed-row-text { display:flex; flex-direction:column; min-width:0; gap:1px; }
.ed-row-key { font-size:9.5px; font-weight:800; letter-spacing:.9px; text-transform:uppercase; color:var(--ed-muted); }
.ed-row-value { font-size:14px; font-weight:750; color:var(--ed-ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ed-row:not(.ed-row-set) .ed-row-value { color:var(--ed-faint); font-weight:600; font-size:13px; }
.ed-row-meta { font-size:11px; font-weight:600; color:var(--ed-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ed-row-meta:empty { display:block; }
.ed-row-flash { animation:ed-flash .5s var(--ed-ease); }
.ed-row-nudge { animation:ed-nudge .35s; }
@keyframes ed-flash { 0% { background:var(--ed-accent-soft); } 100% { background:transparent; } }
@keyframes ed-nudge { 25% { transform:translateX(-4px); } 75% { transform:translateX(4px); } }

.ed-note { margin:0; font-size:11.5px; line-height:1.45; color:var(--ed-muted); }
.ed-note.ed-note-ready { color:var(--ed-ready); font-weight:700; }

/* ---------- compact trigger (chat toolbar) ---------- */
.ed.ed-compact { width:auto; max-width:none; margin:0; }
.ed-mini { display:none; }
.ed-compact .ed-mini {
  display:inline-flex;
  align-items:center;
  gap:8px;
  height:36px;
  border:1px solid var(--ed-line);
  background:#fff;
  border-radius:99px;
  padding:0 14px 0 5px;
  font:700 12.5px/1 'Manrope',Arial,sans-serif;
  color:var(--ed-ink);
  cursor:pointer;
  transition:border-color .2s, box-shadow .2s;
}
.ed-compact .ed-mini:hover { border-color:#c8d2bd; box-shadow:0 2px 8px -4px #26322240; }
.ed-compact > .ed-body { display:none; }
.ed-mini-ring { fill:none; stroke:#cdd6c5; stroke-width:4; }
.ed-mini-done .ed-mini-ring { stroke:var(--ed-ready); }
.ed-mini-text { white-space:nowrap; }

/* ---------- centred modal ---------- */
html.ed-lock-scroll, html.ed-lock-scroll body { overflow:hidden; }
.ed-pop {
  position:fixed;
  inset:0;
  z-index:9998;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:#182017b3;
  opacity:0;
  transition:opacity .2s;
}
.ed-pop.ed-pop-in { opacity:1; }
.ed-pop-panel {
  width:min(680px, 100%);
  max-height:calc(100svh - 32px);
  overflow:auto;
  overscroll-behavior:none;
  background:linear-gradient(180deg,#fdfefc,#f5f7f1);
  border:1px solid var(--ed-line);
  border-radius:28px;
  padding:22px;
  box-shadow:0 30px 70px -24px #10180fa0;
  transform:translateY(10px) scale(.98);
  transition:transform .28s var(--ed-ease);
}
.ed-pop-in .ed-pop-panel { transform:none; }
.ed-pop-panel .ed-body {
  display:grid;
  grid-template-columns:minmax(0, 360px) minmax(0, 1fr);
  align-items:center;
  gap:24px;
}
.ed-pop-panel .ed-summary { max-width:none; }
@media (max-width: 640px) {
  .ed-pop { padding:10px; align-items:flex-end; }
  .ed-pop-panel { padding:16px 16px 18px; border-radius:24px; }
  .ed-pop-panel .ed-body { display:flex; flex-direction:column; gap:14px; }
  .ed-pop-panel .ed-face { max-width:min(340px, 88vw, calc(100svh - 360px)); min-width:250px; }
  .ed-pop-panel .ed-row { padding:8px 12px; }
  .ed-pop-panel .ed-note { display:none; }
}

/* accessibility + motion */
@media (prefers-reduced-motion: reduce) {
  .ed-check, .ed-check.ed-check-ready, .ed-row-flash, .ed-row-nudge { animation:none; }
  .ed-seg, .ed-check, .ed-track, .ed-lens, .ed-pop, .ed-pop-panel { transition:none; }
}

/* keep the native selects as the data layer, visually out of the way */
.ed-native[hidden] { display:none!important; }

/* Smooth, stable dragging on touch devices */
.ed-face { contain:layout paint; touch-action:none; -webkit-touch-callout:none; }
.ed-ring { will-change:transform; }
.ed-row-meta { min-height:15px; }
.ed-pop { overscroll-behavior:none; touch-action:none; }
.ed-pop-panel { touch-action:pan-y; }
@media (max-width:640px) { .ed-pop-panel { align-self:flex-end; } }

/* One colour per ring: Paper = blue, Session = violet, Question = green */
.ed, .ed-body {
  --ed-c-paper:#3d6fb5;
  --ed-c-session:#7a56c2;
  --ed-c-question:#2a8a5a;
}
.ed-ring-paper .ed-seg { --seg:var(--ed-c-paper); }
.ed-lens.ed-lens-paper.ed-lens-on { fill:var(--ed-c-paper); stroke:var(--ed-c-paper); }
.ed-lens.ed-lens-session.ed-lens-on { fill:var(--ed-c-session); stroke:var(--ed-c-session); }
.ed-lens.ed-lens-question.ed-lens-on { fill:var(--ed-c-question); stroke:var(--ed-c-question); }
.ed-lens-session { stroke:color-mix(in srgb, var(--ed-c-session) 45%, #fff); }
.ed-lens-question { stroke:color-mix(in srgb, var(--ed-c-question) 45%, #fff); }
.ed-track-session { stroke:color-mix(in srgb, var(--ed-c-session) 7%, #f3f1f8); }
.ed-track-question { stroke:color-mix(in srgb, var(--ed-c-question) 7%, #eef5f0); }
.ed-track-session.ed-next { stroke:color-mix(in srgb, var(--ed-c-session) 16%, #f3f1f8); }
.ed-track-question.ed-next { stroke:color-mix(in srgb, var(--ed-c-question) 16%, #eef5f0); }
.ed-track-session.ed-locked, .ed-track-question.ed-locked { stroke:#f1f3ee; }
.ed-ring-session .ed-tick { stroke:color-mix(in srgb, var(--ed-c-session) 50%, #fff); }
.ed-ring-question .ed-tick { stroke:color-mix(in srgb, var(--ed-c-question) 50%, #fff); }
.ed-ring-session .ed-label-session { fill:color-mix(in srgb, var(--ed-c-session) 70%, #1f2620); }
.ed-ring-question .ed-label-question { fill:color-mix(in srgb, var(--ed-c-question) 70%, #1f2620); }
.ed-ring-session .ed-item.ed-in-lens .ed-label, .ed-ring-question .ed-item.ed-in-lens .ed-label { fill:#fff; }
.ed-row-paper { --row-c:var(--ed-c-paper); }
.ed-row-session { --row-c:var(--ed-c-session); }
.ed-row-question { --row-c:var(--ed-c-question); }
.ed-row-dot { border-color:color-mix(in srgb, var(--row-c) 55%, #fff); color:var(--row-c); }
.ed-row-next .ed-row-dot { border-color:var(--row-c); color:var(--row-c); background:color-mix(in srgb, var(--row-c) 12%, #fff); }
.ed-row-set .ed-row-dot { background:var(--row-c); border:0; }
.ed-row-key { color:var(--row-c); }
.ed-row-set { box-shadow:inset 3px 0 0 var(--row-c); }
.ed-ring-paper.ed-next .ed-seg { fill:color-mix(in srgb, var(--ed-c-paper) 20%, #fbfcf8); }
.ed-root-next, .ed[data-next="paper"] .ed-step-name { color:var(--ed-c-paper); }
.ed[data-next="session"] .ed-step-name, .ed-body[data-next="session"] .ed-step-name { color:var(--ed-c-session); }
.ed[data-next="question"] .ed-step-name { color:var(--ed-c-question); }

.ed-body[data-next="paper"] .ed-step-name { color:var(--ed-c-paper); }
.ed-body[data-next="question"] .ed-step-name { color:var(--ed-c-question); }

/* Qualification ring (outermost): IAL / International GCSE */
.ed, .ed-body { --ed-c-qual:#b26b2a; }
.ed-ring-qual .ed-seg { --seg:var(--ed-c-qual); }
.ed-ring-qual.ed-next .ed-seg { fill:color-mix(in srgb, var(--ed-c-qual) 20%, #fbfcf8); }
.ed-label-qual { font-size:10.5px; font-weight:800; letter-spacing:1.2px; transition:fill .25s; }
.ed-label-qual-sub { font-size:5.4px; font-weight:700; letter-spacing:1.3px; fill:var(--ed-muted); transition:fill .25s; }
.ed-label-qual.ed-on { fill:#fff; }
.ed-label-qual-sub.ed-on { fill:#ffffffd0; }
.ed-row-qual { --row-c:var(--ed-c-qual); }
.ed[data-next="qual"] .ed-step-name, .ed-body[data-next="qual"] .ed-step-name { color:var(--ed-c-qual); }
/* Smoother colour changes while a ring turns */
.ed-seg { transition:fill .32s var(--ed-ease), stroke .32s var(--ed-ease); }
.ed-label-paper, .ed-label-paper-sub { transition:fill .32s var(--ed-ease); }
.ed-item .ed-label { transition:fill .25s var(--ed-ease); }
.ed-lens { transition:fill .25s var(--ed-ease), stroke .25s var(--ed-ease); }
/* Short screens (phones in landscape, small tablets): size the dial by height so the whole bezel fits */
.ed-pop-panel .ed-face { max-width:min(360px, calc(100svh - 96px)); }
@media (max-height:560px) {
  .ed-pop { padding:8px; align-items:center; }
  .ed-pop-panel { padding:12px 16px; border-radius:20px; max-height:calc(100svh - 16px); }
  .ed-pop-panel .ed-body { display:grid; grid-template-columns:auto minmax(0, 1fr); gap:16px; align-items:center; }
  .ed-pop-panel .ed-face { width:calc(100svh - 56px); max-width:calc(100svh - 56px); min-width:0; }
  .ed-pop-panel .ed-row { padding:6px 10px; }
  .ed-pop-panel .ed-row-meta { min-height:0; }
  .ed-pop-panel .ed-note { display:none; }
}
/* The open dial sits above the analytics consent bar (z-index 9999) so it never covers the bezel */
.ed-pop { z-index:10000; }
