/* KAHReady SG V6.14.11 — institutional assessment system
   Visual master: institutional navy + warm cream + white + restrained gold.
   Interaction master: simplified exam shell with first-class navigator. */
:root{
  --kr-navy:#071f36;
  --kr-navy-2:#0b3557;
  --kr-blue:#176fc0;
  --kr-blue-soft:#edf4fb;
  --kr-gold:#d8a63e;
  --kr-gold-soft:#fbf3df;
  --kr-cream:#f6f1e8;
  --kr-cream-2:#fbf8f2;
  --kr-ink:#10263b;
  --kr-muted:#687d8f;
  --kr-line:#d8e1e7;
  --kr-surface:#ffffff;
  --kr-success:#16734a;
  --kr-danger:#9a2d39;
  --kr-focus:#176fc0;
}

/* Pre-paint governed launch gate. All learner-account launch URLs target #quiz.
   Before JavaScript/auth/D1 hydration completes, never paint the marketing home
   page underneath the requested assessment. Show one calm loading surface, then
   hand over to the normal exam-focus UI as soon as the learning engine binds.
   Save & Exit has an explicit assessment-exiting state so Safari cannot briefly
   reinterpret a stale #quiz target as a new assessment launch. */
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled)){background:linear-gradient(180deg,#fbf8f2 0%,var(--kr-cream) 100%);min-height:100vh;overflow:hidden}
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled))>.topbar,
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled))>.sticky-buy,
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled))>.bottom-nav,
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled))>.footer{display:none!important}
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled)) #mainContent{padding-top:0!important;min-height:100vh}
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled)) .view{display:none!important}
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled)) #quiz{display:block!important;position:relative;min-height:100vh;background:linear-gradient(180deg,#fbf8f2 0%,var(--kr-cream) 100%)}
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled)) #quiz>.quiz-workspace,
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled)) #quiz>.question-palette,
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled)) #quiz>.palette-backdrop{visibility:hidden!important}
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled)) #quiz::before{content:'Preparing secure assessment';position:fixed;z-index:999;left:50%;top:44%;transform:translate(-50%,-50%);width:min(520px,calc(100vw - 40px));padding:28px 30px 58px;border:1px solid #d8e1e7;border-radius:16px;background:#fff;color:var(--kr-navy);box-shadow:0 18px 50px rgba(7,31,54,.08);font-size:1.08rem;font-weight:800;text-align:center;letter-spacing:-.01em}
body:not(.exam-focus):not(.assessment-exiting):has(#quiz:target):has(#qExit:not(:disabled)) #quiz::after{content:'Verifying your saved position, access and governed question set…';position:fixed;z-index:1000;left:50%;top:calc(44% + 27px);transform:translateX(-50%);width:min(430px,calc(100vw - 70px));color:var(--kr-muted);font-size:.86rem;line-height:1.5;text-align:center}

body.exam-focus{background:var(--kr-cream);color:var(--kr-ink)}
body.exam-focus>.topbar,
body.exam-focus>.sticky-buy,
body.exam-focus>.bottom-nav{display:none!important}
body.exam-focus #mainContent{padding-top:0!important}
body.exam-focus .quiz-workspace{padding:0 0 64px!important;background:linear-gradient(180deg,#fbf8f2 0%,var(--kr-cream) 100%)}
body.exam-focus .quiz-layout,
body.exam-focus .assessment-layout{grid-template-columns:minmax(0,1fr)!important;max-width:1060px;margin:0 auto;padding-inline:22px}

/* Premium assessment identity — compact and non-obstructive. */
body.exam-focus .quiz-course-header{position:relative;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px 20px;margin:0 auto 18px;max-width:1060px;background:var(--kr-navy);color:#fff;border-radius:0 0 16px 16px;box-shadow:0 12px 30px rgba(7,31,54,.12)}
body.exam-focus .quiz-course-header .section-kicker{color:#9ec7df;font-size:.7rem;letter-spacing:.18em}
body.exam-focus .quiz-course-header strong{display:block;color:#fff;font-size:1rem;line-height:1.28}
body.exam-focus .quiz-header-state{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
body.exam-focus .quiz-timer{color:#fff;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);border-radius:9px;padding:7px 10px;font-variant-numeric:tabular-nums;font-weight:800}
body.exam-focus .quiz-save-status{color:#f7e8bc;background:rgba(216,166,62,.13);border:1px solid rgba(216,166,62,.28);border-radius:9px;padding:7px 10px;font-size:.79rem;font-weight:800}
body.exam-focus .quiz-save-status[data-state="saving"]{opacity:.78}
body.exam-focus .quiz-save-status[data-state="saved"]{color:#d9f4e6;background:rgba(32,141,90,.14);border-color:rgba(86,186,134,.23)}
body.exam-focus .quiz-save-status[data-state="local"]{color:#f7e8bc;background:rgba(216,166,62,.13);border-color:rgba(216,166,62,.28)}

/* Main assessment surface — clean like an exam system, premium like an institution. */
body.exam-focus .premium-quiz-card{overflow:visible;background:var(--kr-surface);border:1px solid #d9e0e4;border-radius:16px;box-shadow:0 18px 50px rgba(7,31,54,.065);padding:0 30px 28px}
body.exam-focus .premium-quiz-card .quiz-exit-row{position:sticky;top:0;z-index:50;margin:0 -30px;padding:10px 18px;background:rgba(255,255,255,.985);border-bottom:1px solid var(--kr-line);border-radius:16px 16px 0 0;box-shadow:0 7px 20px rgba(7,31,54,.055);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
body.exam-focus .premium-quiz-card .quiz-utility-bar{position:relative;top:auto;z-index:10;display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:12px 0 10px;background:#fff;border-bottom:0}
body.exam-focus .quiz-mobile-timer{display:none}
body.exam-focus .quiz-progress-track{height:4px;margin:0 -30px 18px;overflow:hidden;background:#e7ecef;border-radius:0}
body.exam-focus #qProgress{display:block;height:100%;background:linear-gradient(90deg,#bd8d2d,var(--kr-gold));transition:width .2s ease}

/* Primary exam controls. */
body.exam-focus #qExit,
body.exam-focus #qPaletteButton,
body.exam-focus #qPrev,
body.exam-focus #qNext{min-height:46px;border-radius:10px;font-weight:800;letter-spacing:-.01em}
body.exam-focus #qExit{padding-inline:15px;color:var(--kr-navy);background:var(--kr-cream-2);border:1px solid #d8dfdf}
body.exam-focus #qExit:hover,body.exam-focus #qExit:focus-visible{background:#f1ebdf;border-color:#c8d0d2}
body.exam-focus #qPaletteButton{padding-inline:16px;color:var(--kr-navy);background:#fff;border:1px solid #cbd7df;box-shadow:none}
body.exam-focus #qPaletteButton:hover,body.exam-focus #qPaletteButton:focus-visible{background:#f7fafc;border-color:#9bb4c5}
body.exam-focus #qNext{background:var(--kr-navy);border-color:var(--kr-navy);color:#fff;box-shadow:0 7px 18px rgba(7,31,54,.13)}
body.exam-focus #qPrev{background:#fff;border-color:#cbd6dd;color:var(--kr-navy)}
body.exam-focus #qNext:disabled,body.exam-focus #qPrev:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
body.exam-focus button:focus-visible,body.exam-focus a:focus-visible{outline:3px solid color-mix(in srgb,var(--kr-focus) 48%,white);outline-offset:3px}

/* Question hierarchy — calm, readable and sustainable for long study sessions. */
body.exam-focus .question-meta{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:0 0 14px}
body.exam-focus .question-meta>span{border:1px solid #dce4e9;background:#f7f9fa;color:#526b7d;border-radius:999px;padding:5px 9px;font-size:.73rem;font-weight:720}
body.exam-focus .question-meta #qDifficulty{border-color:#ead096;background:var(--kr-gold-soft);color:#886219}
body.exam-focus #qFlag{margin-left:auto;border:1px solid #d3dde3;background:#fff;color:#5f7180;border-radius:9px;padding:8px 11px;font-weight:720}
body.exam-focus #qFlag.active{color:#7c5914;background:var(--kr-gold-soft);border-color:#dfbd69}
body.exam-focus #qText{max-width:800px;margin:0 0 18px;color:#0a2238;font-size:clamp(1.28rem,1.4vw,1.55rem);font-weight:650;line-height:1.43;letter-spacing:-.012em;text-wrap:pretty;scroll-margin-top:82px}
body.exam-focus #qOptions{display:grid;gap:8px}
body.exam-focus .teaser-answer{min-height:52px;padding:12px 16px;border:1px solid #cedbe4;border-radius:11px;background:#fff;color:#173d5b;line-height:1.45;text-align:left;font-size:.94rem;font-weight:600;box-shadow:none;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease,transform .15s ease}
body.exam-focus .teaser-answer:hover:not(:disabled){border-color:#91afc3;background:#fbfcfd;box-shadow:0 6px 16px rgba(7,31,54,.05);transform:translateY(-1px)}
body.exam-focus .teaser-answer.selected{border-color:#4c82d7;background:#eef4ff;color:#245aa6;box-shadow:0 0 0 2px rgba(76,130,215,.08)}
body.exam-focus .teaser-answer.answer-correct{border-color:#57a77d;background:#eef8f2;color:#145f3d;box-shadow:0 0 0 2px rgba(87,167,125,.08)}
body.exam-focus .teaser-answer.answer-wrong{border-color:#d88891;background:#fff1f2;color:#8f2a36;box-shadow:0 0 0 2px rgba(216,136,145,.08)}

/* Teaching feedback appears only when it adds learning value. */
body.exam-focus .quiz-immediate-feedback{margin-top:14px;padding:15px;border:1px solid #dedfd9;border-radius:13px;background:#fbf8f1}
.v61411-feedback{display:grid;gap:10px;padding-top:0;font-size:.94rem}
.v61411-feedback>strong{font-size:1rem;letter-spacing:-.008em}
.v61411-feedback.is-correct>strong{color:var(--kr-success)}
.v61411-feedback.is-wrong>strong{color:var(--kr-danger)}
.v61411-feedback .correct-answer{padding:10px 12px;border-radius:10px;background:#eef8f2;border:1px solid #cfe7da;line-height:1.5}
.v61411-feedback>p{margin:0;line-height:1.62;color:#334e63}
.v61411-feedback>div{display:grid;gap:5px;padding:10px 12px;border-radius:10px;background:#fff;border:1px solid #e0e5e7}
.v61411-feedback>div b{font-size:.71rem;letter-spacing:.1em;text-transform:uppercase;color:#8d681d}
.v61411-feedback>div span{line-height:1.52;color:#405a6d}
body.exam-focus .quiz-keyboard-note{margin-top:15px;padding-top:12px;border-top:1px solid #e1e6e8;color:#82919c;font-size:.75rem}
body.exam-focus .quiz-actions{margin-top:14px}

/* No permanent support sidebar while answering. */
body.exam-focus .quiz-support-panel{display:none!important}

/* Full question navigator: exam-like interaction, institutional styling. */
body.exam-focus .question-palette{position:fixed!important;z-index:120!important;top:68px!important;left:50%!important;right:auto!important;bottom:auto!important;width:min(1000px,calc(100vw - 36px))!important;max-height:calc(100vh - 96px)!important;overflow:auto!important;transform:translateX(-50%)!important;padding:22px!important;background:#fff!important;border:1px solid #d8e0e4!important;border-radius:16px!important;box-shadow:0 28px 80px rgba(7,31,54,.2)!important}
body.exam-focus .question-palette.hidden{display:none!important}
body.exam-focus .palette-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-bottom:14px;border-bottom:1px solid #e3e7e9}
body.exam-focus .palette-head small{color:#9b741f;font-weight:850;letter-spacing:.15em}
body.exam-focus .palette-head h2{margin:.2rem 0 0;color:var(--kr-navy);font-family:Georgia,'Times New Roman',serif;font-size:1.55rem;letter-spacing:-.02em}
body.exam-focus #qPaletteClose{width:42px;height:42px;border-radius:10px;border:1px solid #d3dce2;background:#fff;color:var(--kr-navy);font-size:1.5rem}
body.exam-focus .palette-progress-summary{padding:12px 0 6px;color:var(--kr-muted);font-size:.88rem}
body.exam-focus .palette-legend{display:flex;gap:16px;flex-wrap:wrap;padding:8px 0 14px;color:#526b7d;font-size:.82rem}
body.exam-focus .palette-grid{display:grid!important;grid-template-columns:repeat(10,minmax(44px,1fr))!important;gap:7px!important}
body.exam-focus .palette-grid button{min-width:0!important;min-height:44px!important;border:1px solid #ccd7de!important;border-radius:8px!important;background:#fff!important;color:#31485a!important;font-weight:750!important}
body.exam-focus .palette-grid button.answered{background:#e9f5ee!important;border-color:#9ec9af!important;color:#176845!important}
body.exam-focus .palette-grid button.flagged{box-shadow:inset 0 -4px 0 var(--kr-gold)!important}
body.exam-focus .palette-grid button.current{background:var(--kr-navy)!important;border-color:var(--kr-navy)!important;color:#fff!important;box-shadow:0 0 0 3px rgba(7,31,54,.12)!important}
body.exam-focus .palette-backdrop{position:fixed!important;inset:0!important;z-index:110!important;background:rgba(6,20,34,.46)!important;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
body.exam-focus .palette-backdrop.hidden{display:none!important}

.resume-banner{position:relative;z-index:35}
.resume-banner .wrap{box-shadow:0 10px 26px rgba(7,31,54,.08)}

@media(max-width:900px){
  body.exam-focus .quiz-layout,body.exam-focus .assessment-layout{padding-inline:12px}
  body.exam-focus .quiz-course-header{margin-inline:0;border-radius:0 0 14px 14px;padding:11px 14px}
  body.exam-focus .quiz-course-header .section-kicker{display:none}
  body.exam-focus .quiz-course-header strong{font-size:.92rem}
  body.exam-focus .quiz-header-state{gap:6px}
  body.exam-focus .quiz-timer,body.exam-focus .quiz-save-status{padding:7px 8px;font-size:.75rem}
  body.exam-focus .premium-quiz-card{padding:0 18px 22px}
  body.exam-focus .premium-quiz-card .quiz-exit-row{margin:0 -18px;padding:10px 12px}
  body.exam-focus .quiz-progress-track{margin-inline:-18px}
  body.exam-focus #qText{max-width:760px;font-size:clamp(1.24rem,3vw,1.45rem);line-height:1.42;scroll-margin-top:76px}
  body.exam-focus .palette-grid{grid-template-columns:repeat(8,minmax(42px,1fr))!important}
}

@media(max-width:640px){
  body.exam-focus{background:#f7f3eb;padding-bottom:86px}
  body.exam-focus .quiz-course-header{display:grid;grid-template-columns:1fr auto;gap:7px}
  body.exam-focus .quiz-header-state{grid-column:1/-1;justify-content:space-between}
  body.exam-focus .premium-quiz-card{border-radius:14px;padding-inline:14px}
  body.exam-focus .premium-quiz-card .quiz-exit-row{margin-inline:-14px;border-radius:14px 14px 0 0}
  body.exam-focus .quiz-utility-bar{align-items:stretch;flex-direction:column;padding-top:10px}
  body.exam-focus #qPaletteButton{width:100%}
  body.exam-focus .question-meta{margin-bottom:12px}
  body.exam-focus #qFlag{margin-left:0}
  body.exam-focus #qText{font-size:1.18rem;font-weight:640;line-height:1.46;margin-bottom:16px;scroll-margin-top:74px}
  body.exam-focus #qOptions{gap:7px}
  body.exam-focus .teaser-answer{min-height:50px;padding:11px 13px;border-radius:10px;font-size:.93rem;line-height:1.43}
  body.exam-focus .quiz-keyboard-note{display:none}
  body.exam-focus .quiz-actions{position:fixed;left:0;right:0;bottom:0;z-index:70;display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:0;padding:10px max(12px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:rgba(255,255,255,.985);border-top:1px solid #d4dde2;box-shadow:0 -8px 24px rgba(7,31,54,.1);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
  body.exam-focus .quiz-actions #qPrev,body.exam-focus .quiz-actions #qNext{width:100%;min-height:50px;margin:0}
  body.exam-focus .question-palette{top:12px!important;width:calc(100vw - 20px)!important;max-height:calc(100vh - 24px)!important;padding:16px!important;border-radius:14px!important}
  body.exam-focus .palette-grid{grid-template-columns:repeat(5,minmax(42px,1fr))!important;gap:6px!important}
  .v61411-feedback{font-size:.93rem}
}

@media(prefers-reduced-motion:reduce){
  body.exam-focus *,body.exam-focus *::before,body.exam-focus *::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}
@media(prefers-contrast:more){
  body.exam-focus .teaser-answer,body.exam-focus .premium-quiz-card,body.exam-focus .question-palette{border-width:2px!important}
}