:root {color-scheme: dark; font-family: var(--projection-font, "AnnotationM Nerd Font", monospace); background: #000000; color: #d7dce2;}
* {box-sizing: border-box;}
[hidden] {display: none !important;}
body {margin: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;}
button {background: #252c35; color: inherit; border: 1px solid #46515f; border-radius: 10px; padding: 12px 18px; font: inherit; cursor: pointer; min-height: 48px;}
button:disabled {opacity: .5; cursor: default;}
#controls {width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 28px; border: 1px solid #46515f; border-radius: 20px; background: #101318; color: #d7dce2; font-size: 18px; box-shadow: 0 24px 80px #000b; overflow: auto;}
#controls::backdrop {background: #0006;}
.menu-heading {display: flex; align-items: center; justify-content: space-between; gap: 16px;}
#controls-title {margin: 0; color: #a6dcc7; font-size: 28px;}
#status {margin: 16px 0 24px; color: #aab5c2; font-size: 16px;}
#appearance {display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;}
#appearance label, #font-family {grid-column: 1 / -1;}
#appearance label {margin: 0;}
#font-family {width: 100%; min-width: 0; padding: 14px; background: #252c35; color: inherit; border: 1px solid #46515f; border-radius: 10px; font: inherit;}
#zoom-reset {font-variant-numeric: tabular-nums;}
#zoom-in, #zoom-out {font-size: 28px;}
#fullscreen {width: 100%; margin-top: 20px;}
#font-status {display: block; color: #d5c99a; font-size: 16px; margin-top: 12px;}
.menu-hint {color: #aab5c2; font-size: 14px; margin: 20px 0 0;}
@media (max-width: 400px) {#controls {padding: 20px;} #controls-title {font-size: 24px;}}
#terminal {flex: 1; min-height: 0; min-width: 0; width: 100%; overflow: hidden; padding: 4px; background: #000000;}
.xterm {height: 100%;}
.xterm-viewport {overflow: hidden !important;}
/* Paint all cell backgrounds below the row's glyphs. Otherwise the next
   span's opaque background cuts off wide Nerd Font artwork (e.g. U+E0C8).
   Keep xterm's cell positions, colors, selection and cursor backgrounds. */
.xterm-rows > div {isolation: isolate;}
.xterm-rows > div > span {position: relative; background-clip: text;}
.xterm-rows > div > span::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: inherit; background-clip: border-box; pointer-events: none;
}
#access {flex: 1; display: grid; place-items: center; padding: 20px; overflow: auto;}
#pairing {width: min(100%, 380px); padding: 28px; border: 1px solid #46515f; border-radius: 12px; background: #181e26;}
h1 {margin: 0 0 24px; font-size: 23px;}
label {display: block; margin-bottom: 10px;}
#code {width: 100%; font-size: 32px; font-family: inherit; letter-spacing: .22em; padding: 12px; background: #000000; color: #fff; border: 1px solid #647386; border-radius: 6px;}
#code:focus {outline: 2px solid #a6dcc7; outline-offset: 2px;}
#pairing-hint {color: #aab5c2; font-size: 14px; line-height: 1.5;}
#connect {width: 100%; padding: 12px; background: #a6dcc7; color: #101318; font-weight: 600;}
#connect:disabled {opacity: .6; cursor: wait;}
#pairing-error {color: #ffb4b4; font-size: 14px; margin-bottom: 0;}

#document { position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: contain; background: black; }
#neutral { position: fixed; inset: 0; background: #111; color: #aaa; align-content: center; text-align: center; font-size: 24px; font-family: inherit; }

#reading {position: fixed; inset: 0; width: 100vw; height: 100dvh; border: 0; background: white;}
#student-controls {position:fixed;bottom:12px;right:12px;z-index:10;display:flex;gap:8px;}
#student-controls[hidden] {display:none;}
#glossary {max-width:min(36rem,calc(100vw - 3rem));max-height:80dvh;overflow:auto;border:1px solid #647386;border-radius:12px;padding:24px;background:#fff;color:#17212b;}
#glossary::backdrop {background:#0006;}
#glossary-definition {white-space:pre-wrap;line-height:1.6;}
#glossary button {color:#fff;background:#252c35;}
#pdf-reader {position:fixed;bottom:12px;left:12px;z-index:10;display:flex;align-items:center;gap:8px;background:#101318dd;border-radius:10px;}
#pdf-reader[hidden] {display:none;}
#pdf-regions {position:fixed;inset:0;pointer-events:none;z-index:2;}
.pdf-term {position:absolute;pointer-events:auto;min-height:0;padding:0;border:0;border-bottom:1px dotted #287a83;background:transparent;border-radius:0;cursor:help;}
.pdf-term:focus-visible,.pdf-term:hover {outline:2px solid #287a83;background:#287a8322;}
@media(max-width:600px){#pdf-reader{bottom:72px;}}
