/* Kiosk mode (static/kiosk/kiosk.js): plain clicks only, and the on-screen
 * keypad in the bench look. Loaded only by /kiosk pages. */
html, body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
img, a, svg { -webkit-user-drag: none; }

/* Sean, 29 Oct: the keypad floats over the page, a window the student drags
 * by its top bar (kiosk.js sets left, top and zoom), so the page never moves. */
.kp { position: fixed; left: 0; top: 0; z-index: 70; width: 600px; display: grid; gap: 6px; padding: 0 10px 10px; background: #1F3D2B; border: 3px solid #1B1B1B; box-shadow: 6px 6px 0 #1B1B1B; }
.kp[hidden] { display: none; }
.kp-grip { display: flex; align-items: center; gap: 6px; margin: 0 -10px; padding: 6px 10px; background: #1B1B1B; cursor: grab; touch-action: none; }
.kp-dragging .kp-grip { cursor: grabbing; }
.kp-dragging { opacity: .9; }
.kp-move { flex: 1 1 auto; color: #F5F1E8; font: 600 .95rem/1 "IBM Plex Mono", ui-monospace, Consolas, monospace; letter-spacing: .03em; }
.kp-keys { display: grid; gap: 6px; }
.kp-keys[hidden] { display: none; }
.kp:has(.kp-keys[hidden]) { padding-bottom: 0; }
.kp-row { display: flex; gap: 6px; }
.kp-k { flex: 1 1 0; min-width: 0; min-height: 44px; font: 600 1.2rem/1 "IBM Plex Mono", ui-monospace, Consolas, monospace; color: #1B1B1B; background: #F3EEE2; border: 3px solid #1B1B1B; box-shadow: 3px 3px 0 #1B1B1B; cursor: pointer; touch-action: manipulation; }
.kp-k:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #1B1B1B; background: #D4A017; }
.kp-tab, .kp-word { font-size: 1rem; }
.kp-tab.on, .kp-shift.on { background: #D4A017; }
.kp-small { flex: 0 0 auto; min-height: 36px; padding: 0 .7rem; font-size: .9rem; box-shadow: none; border-color: #5A5A52; }
.kp-space { flex: 3 1 0; }
.kp-back, .kp-next { flex: 1.4 1 0; font-size: 1rem; }
.kp-enter { flex: 1.6 1 0; font-size: 1rem; background: #a04e1d; color: #fff; }
/* Sean, 29 Oct: a long job list scrolls in its own box, about half the screen
 * tall (--kvh is the screen height in page pixels, set by kiosk.js). */
.bb-jobs ol { max-height: calc(var(--kvh, 100vh) * .5); overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: auto; scrollbar-color: #1B1B1B #E8E1D0; }
/* Size (Sean, 29 Oct: lab monitors are 27 inch). The landing page is 50%
 * bigger on a wide screen; a bench has a size bar (kiosk.js sets the zoom). */
@media (min-width: 1500px) { html.kland { zoom: 1.5; } }
.ksize { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #F5F1E8; color: #1B1B1B; border: 3px solid #1B1B1B; box-shadow: 4px 4px 0 #1B1B1B; font: 600 .9rem/1 "IBM Plex Mono", ui-monospace, Consolas, monospace; }
.ksize button { width: 40px; height: 40px; font: 700 1.3rem/1 "IBM Plex Mono", ui-monospace, monospace; color: #1B1B1B; background: #F3EEE2; border: 3px solid #1B1B1B; cursor: pointer; touch-action: manipulation; }
.ksize button:active { background: #D4A017; }
.ksize input { width: 140px; accent-color: #C2622F; cursor: pointer; }
.ksize output { min-width: 4ch; text-align: right; }
/* Period timer (Sean, 29 Oct): the button bottom left, the strip across the top. */
.ktimer-btn { position: fixed; left: 16px; bottom: 16px; z-index: 60; min-height: 44px; font: 600 .9rem/1 "IBM Plex Mono", ui-monospace, Consolas, monospace; color: #1B1B1B; background: #F5F1E8; border: 3px solid #1B1B1B; box-shadow: 4px 4px 0 #1B1B1B; padding: .5rem .9rem; cursor: pointer; }
.ktimer { position: fixed; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: baseline; justify-content: center; gap: .8rem; padding: .35rem 9rem .45rem 1rem; background: #1B1B1B; color: #F5F1E8; font: 600 1.1rem/1.2 "IBM Plex Mono", ui-monospace, Consolas, monospace; }
.ktimer[hidden] { display: none; }
.ktimer b { font-size: 2rem; color: #D4A017; letter-spacing: .03em; }
body.ktimer-on { padding-top: 3.4rem; }
/* The day's steps in the timer strip (Sean, 29 Oct): the one in progress lit with its time left. */
.ksteps { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.kstep { font-size: .95rem; padding: .15rem .55rem; border: 2px solid #5A5A52; color: #b9b2a2; }
.kstep.past { opacity: .45; text-decoration: line-through; }
.kstep.on { border-color: #D4A017; color: #1B1B1B; background: #D4A017; font-weight: 700; }
.kstep.on b { font-size: 1.15rem; color: #1B1B1B; }
.ktimer { align-items: center; flex-wrap: wrap; }
/* Refresh (Sean, 29 Oct): beside the period timer button, bottom left. */
.krefresh { position: fixed; left: 16px; bottom: 72px; z-index: 60; min-height: 44px; font: 600 .9rem/1 "IBM Plex Mono", ui-monospace, Consolas, monospace; color: #1B1B1B; background: #F5F1E8; border: 3px solid #1B1B1B; box-shadow: 4px 4px 0 #1B1B1B; padding: .5rem .9rem; cursor: pointer; }
.krefresh:active, .ktimer-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #1B1B1B; }
/* Next at the bottom of each lesson activity (Sean, Oct 30) */
/* Sean, Nov 2: Back and Next sit bottom right on every activity, above the
 * size bar and Trace table button where those show; the page keeps room for them. */
.lesson-next { position: fixed; right: 16px; bottom: 16px; z-index: 61; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; max-width: calc(100vw - 32px); }
body:has(.ksize) .lesson-next { bottom: 136px; }
body:has(.lesson-next) { padding-bottom: 96px; }
.next-go.back { background: #F5F1E8; }
@media (max-width: 600px) { .next-go { font-size: .95rem; padding: .6rem .9rem .5rem; } }
.next-go { display: inline-block; font-family: "Carey Type", Impact, Haettenschweiler, sans-serif; text-transform: uppercase; letter-spacing: .05em; font-size: 1.15rem; color: #1B1B1B; background: #D4A017; border: 3px solid #1B1B1B; box-shadow: 5px 5px 0 #1B1B1B; padding: .75rem 1.3rem .65rem; text-decoration: none; }
.next-go:hover { transform: translate(-1px, -1px); box-shadow: 7px 7px 0 #1B1B1B; }
/* Trace table (Sean, Nov 2): a floating scratch grid, dragged like the keypad
 * (kiosk.js sets left, top and zoom); its button sits above the size bar. */
.kt-open { position: fixed; right: 16px; bottom: 76px; z-index: 60; min-height: 44px; font: 600 .95rem/1 "IBM Plex Mono", ui-monospace, Consolas, monospace; color: #1B1B1B; background: #F5F1E8; border: 3px solid #1B1B1B; box-shadow: 4px 4px 0 #1B1B1B; padding: .5rem .9rem; cursor: pointer; }
.kt-open.on, .kt-open:active { background: #D4A017; }
.kt { position: fixed; left: 0; top: 0; z-index: 69; width: max-content; min-width: 340px; padding: 0 10px 10px; background: #F5F1E8; border: 3px solid #1B1B1B; box-shadow: 6px 6px 0 #1B1B1B; }
.kt[hidden] { display: none; }
.kt-body { display: grid; gap: 8px; padding-top: 10px; }
.kt-grid { display: grid; gap: 0; border-left: 2px solid #1B1B1B; border-top: 2px solid #1B1B1B; }
.kt-grid > * { border-right: 2px solid #1B1B1B; border-bottom: 2px solid #1B1B1B; }
.kt-n { display: flex; align-items: center; justify-content: center; font: 600 .85rem/1 "IBM Plex Mono", ui-monospace, monospace; color: #5A5A52; background: #E8E1D0; }
.kt-head, .kt-cell { width: 100%; min-width: 0; box-sizing: border-box; min-height: 40px; padding: .3rem .45rem; font: 500 1.1rem/1.2 "IBM Plex Mono", ui-monospace, Consolas, monospace; color: #1B1B1B; background: #fff; border: 0; border-radius: 0; text-align: center; }
.kt-head { font-weight: 700; background: #E8E1D0; }
.kt-head:focus, .kt-cell:focus { outline: 3px solid #C2622F; outline-offset: -3px; }
.kt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kt-tools .kp-small { background: #F3EEE2; border-color: #1B1B1B; }
.kt-note { margin-left: auto; font: 500 .8rem/1 "IBM Plex Mono", ui-monospace, monospace; color: #5A5A52; }
/* Boxes (Sean, Nov 4): the box method, a name and a row of boxes per variable;
 * the last box is the value now, earlier boxes gray. Same window as the trace table. */
.kb-list { display: grid; gap: 6px; }
.kb-row { display: flex; align-items: stretch; gap: 0; }
.kb-row > input { flex: 0 0 auto; border: 2px solid #1B1B1B; margin-left: -2px; }
.kb-row > .kb-name { width: 7em; margin-left: 0; margin-right: 8px; }
.kb-row > .kb-box { width: 4.6em; }
.kb-row > .kb-old { color: #8A8A80; background: #EFEBE1; }
.kb-row > .kb-add { margin-left: 8px; min-width: 40px; }
/* The kiosk shows no answers (Sean, Nov 2): no "Check your answer" boxes, choices are not buttons to press. */
html.klocked details.check { display: none; }
html.klocked .ti-choice { cursor: default; }

/* Page tools (Sean, Nov 2): Refresh, the period timer button and the size bar
 * fold into one small ghosted button, bottom left; Back / Next and the Trace
 * table button stay up, smaller, so they cover less of the page. */
.ktools { position: fixed; left: 12px; bottom: 12px; z-index: 62; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ktools-btn { font: 600 .8rem/1 "IBM Plex Mono", ui-monospace, Consolas, monospace; color: #1B1B1B; background: rgba(245, 241, 232, .55); border: 2px solid rgba(27, 27, 27, .5); padding: .4rem .65rem; cursor: pointer; }
.ktools-btn:hover, .ktools-btn.on { background: #F5F1E8; border-color: #1B1B1B; }
.ktools-body { display: grid; gap: 8px; background: #F5F1E8; border: 3px solid #1B1B1B; box-shadow: 4px 4px 0 #1B1B1B; padding: 10px; }
.ktools-body[hidden] { display: none; }
.ktools-body > .krefresh, .ktools-body > .ktimer-btn, .ktools-body > .ksize { position: static; box-shadow: none; }
html.klocked .kt-open { left: 150px; right: auto; bottom: 12px; min-height: 0; padding: .4rem .7rem; font-size: .8rem; box-shadow: 3px 3px 0 #1B1B1B; }
html.klocked .lesson-next, html.klocked body:has(.ksize) .lesson-next { bottom: 12px; right: 12px; gap: 8px; }
html.klocked .next-go { font-size: .82rem; padding: .4rem .7rem .32rem; border-width: 2px; box-shadow: 3px 3px 0 #1B1B1B; }
html.klocked body:has(.lesson-next) { padding-bottom: 56px; }
