:root{color-scheme:light;--ink:#271942;--blue:#1677e8;--pink:#f13f85;--orange:#ff8a36;--mint:#2cc7a0;--purple:#6c3ce9;--sky:#eef6ff;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
*{box-sizing:border-box;border-radius:0!important}
body{margin:0;color:var(--ink);background:var(--sky)}
button,textarea,input{font:inherit}
button{cursor:pointer}
.page{width:min(1160px,calc(100% - 32px));margin:auto;padding:34px 0 54px}
.hero{margin-bottom:20px}
h1{margin:0;color:var(--blue);font-size:clamp(2.2rem,5.5vw,4rem);letter-spacing:-.065em;line-height:1}
.celtic-border{width:min(440px,85vw);height:24px;margin-top:12px;opacity:.28}
.celtic-border svg{display:block;width:100%;height:100%}
.celtic-border path{fill:none;stroke:var(--blue);stroke-width:2;stroke-linecap:square;stroke-linejoin:miter}
.celtic-border .heather{stroke:#7650a8}
.example-hint{margin:0 0 10px;color:#526677;font-size:.94rem;line-height:1.4}
.builder{display:grid;grid-template-columns:minmax(0,1fr) 280px;background:#fff;border:2px solid var(--blue)}
.builder textarea{grid-row:1/3;width:100%;min-height:188px;resize:vertical;border:0;border-right:1px solid #c9d9ef;padding:18px;color:var(--ink);outline:0;line-height:1.55}
.builder textarea:focus{box-shadow:inset 4px 0 0 var(--pink)}
.example-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:12px}
.example-buttons button,.toolbar button{border:1px solid var(--blue);padding:10px;color:#124f9d;background:#dcecff;font-weight:750}
.example-buttons button:hover,.toolbar button:hover:not(:disabled){color:#fff;background:var(--purple)}
#generate{border:0;border-top:1px solid var(--blue);padding:12px;color:#fff;background:var(--blue);font-weight:850;box-shadow:inset 0 -5px 0 var(--pink)}
#generate:disabled,.toolbar button:disabled{cursor:default;opacity:.55}
.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:18px 0 8px}
.answer-switch{display:inline-flex;align-items:center;gap:10px;border:1px solid var(--blue);padding:9px 13px;background:#fff;font-weight:750;cursor:pointer}
.answer-switch input{width:18px;height:18px;accent-color:var(--blue)}
.reroll-hint{margin:0 0 8px;color:#526677;font-size:.88rem;line-height:1.4}
#status{min-height:1.5em;margin:6px 0 18px;color:#705d86;font-size:.9rem;font-weight:700}
#status.error{color:#a92158}
.worksheet{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.worksheet-title{grid-column:1/-1;margin:0;color:#124f9d;font-size:1.5rem}
.question-card{min-width:0;break-inside:avoid;border:2px solid var(--blue);background:#fff;padding:16px}
.question-card:nth-child(4n+1){border-top:5px solid var(--orange)}
.question-card:nth-child(4n+2){border-top:5px solid var(--pink)}
.question-card:nth-child(4n+3){border-top:5px solid var(--mint)}
.question-card:nth-child(4n+4){border-top:5px solid var(--blue)}
.question-card h2{margin:0 0 8px;color:#124f9d;font-size:1.18rem}
.question-heading{display:flex;justify-content:space-between;align-items:start;gap:10px;margin-bottom:8px}.question-heading h2{margin:0}.keep-question{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;color:#124f9d;font-size:.82rem;font-weight:750;cursor:pointer}.keep-question input{width:16px;height:16px;margin:0;accent-color:var(--blue)}
.question-card p{margin:6px 0;line-height:1.45}
.givens{margin:9px 0 14px;padding-left:20px;font-size:.9rem}
.diagram{position:relative;display:grid;place-items:center;min-height:240px;overflow:hidden;margin:0 0 12px;border:1px solid #d5e5f8;background:#fff}
.student-figure,.answer-figure{width:100%}
.diagram img{display:block;max-width:100%;width:100%;max-height:320px;height:auto;object-fit:contain}
.answer-figure{display:none}
.worksheet.show-answers .student-figure{display:none}
.worksheet.show-answers .answer-figure{display:block}
.answers{border-left:4px solid var(--mint);background:#f0fffa;padding:9px 12px;margin:0 0 12px}
.worksheet:not(.show-answers) .answers{display:none}
.answers h3{margin:0 0 5px;font-size:1rem}
.answers ul{margin:0;padding-left:20px}
.answers li{margin:3px 0;overflow-wrap:anywhere}
.question-card details{margin-top:16px;border-top:1px solid #d5e5f8}
.question-card summary{padding:9px 0;cursor:pointer;color:#124f9d;font-size:.85rem;font-weight:750}
.program-note{margin:0 0 10px!important;color:#526677;font-size:.78rem}
.program-label{display:block;margin:11px 0 5px;color:#124f9d;font-size:.82rem;font-weight:750}
.program-editor{display:block;width:100%;min-height:130px;resize:vertical;border:1px solid #b8d0ee;background:#f8fbff;padding:9px;color:var(--ink);font:.77rem/1.5 ui-monospace,Consolas,monospace;white-space:pre;overflow:auto}
.program-editor:focus{outline:2px solid var(--blue);outline-offset:1px}
.rerender-question{margin-top:11px;border:1px solid var(--blue);background:#dcecff;color:#124f9d;padding:8px 11px;font-size:.83rem;font-weight:750}
.rerender-question:disabled{cursor:default;opacity:.55}
.program-feedback{min-height:1.2em;margin:7px 0 0!important;color:#526677;font-size:.8rem}
.program-feedback.error{color:#a92158}
.site-footer{margin-top:28px;border-left:3px solid var(--blue);padding:4px 0 4px 14px;color:#705d86;font-size:.96rem;line-height:1.5}
.site-footer p{margin:0 0 5px}
.site-footer a{color:#124f9d;font-weight:800}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
@media(max-width:780px){.builder{grid-template-columns:1fr}.builder textarea{grid-row:auto;border-right:0;border-bottom:1px solid #c9d9ef}.worksheet{grid-template-columns:1fr}}
@media print{@page{size:letter;margin:.55in}body{background:#fff}.page{width:100%;padding:0}.hero,.example-hint,.builder,.toolbar,.reroll-hint,#status,.site-footer,.question-card details,.keep-question{display:none!important}.worksheet{gap:10px}.question-card{border:1px solid #aaa;padding:10px;page-break-inside:avoid}.question-card h2{color:#000}.diagram{min-height:150px}.diagram img{max-height:200px}body[data-print-mode="worksheet"] .student-figure{display:block!important}body[data-print-mode="worksheet"] .answer-figure,body[data-print-mode="worksheet"] .answers{display:none!important}body[data-print-mode="answers"] .student-figure{display:none!important}body[data-print-mode="answers"] .answer-figure,body[data-print-mode="answers"] .answers{display:block!important}body[data-print-mode="answers"] .worksheet-title::after{content:"CoreGX answer key · Print or Save as PDF";display:block;margin-top:4px;color:#526677;font-size:.65em;font-weight:400}}
