/* Cockpit dashboard: exercise bar on top, instruments as tiles in slots (layout.js scales and places them). */
.dashpage main.dashmain { display: block; padding: 8px 14px 14px; }
.dash { position: relative; margin: 0 auto; }
.tile { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.tile > iframe { display: block; border: 0; background: transparent; }
.tile .g5 { position: absolute; left: 0; top: 0; }

/* rearrange mode: the instruments stop taking input; drag one onto another to swap them */
.dash.arr .tile { cursor: grab; outline: 2px dashed #5aa0ff88; outline-offset: 2px; border-radius: 6px; }
.dash.arr .tile > * { pointer-events: none; }
.dash.arr .tile.drag { opacity: .55; outline-color: #5aa0ff; }
.dash.arr .tile.over { outline: 3px solid #ffd36a; }
/* remove button, rearrange mode */
.dash.arr .tile > .tx { pointer-events: auto; position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid #000; background: #d33; color: #fff; font: 700 15px/20px system-ui; z-index: 5; }
.tx:hover { background: #f44; }
header #arrBtn.on { background: var(--accent); color: #001018; border-color: var(--accent); }

/* ---------- exercise bar ---------- */

/* ---------- annunciator lamps in one thin row ---------- */

/* ---------- basic flight controls: label on the left, value between its two buttons ---------- */
.ctl { width: 200px; height: 257px; display: flex; flex-direction: column; justify-content: space-between; padding: 9px 11px; background: linear-gradient(#26292d, #1b1d20); border-radius: 10px; box-shadow: inset 0 1px 0 #ffffff14, 0 3px 6px #000a; font: 12px/1.3 system-ui, sans-serif; color: #cfd3d8; }
.ctl h4 { margin: 0; font: 700 8.5px system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; color: #8b949e; white-space: nowrap; }
.crow { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.crow .cv { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.crow .cv b { width: 44px; text-align: center; font: 700 14px ui-monospace, monospace; color: #fff; }
.ctl button { background: linear-gradient(#383d44, #2a2e34); border: 1px solid #454b53; border-radius: 5px; color: #e8e8e8; width: 24px; min-width: 0; height: 22px; padding: 0; font-size: 10px; touch-action: none; }
.ctl button:active { background: #454b54; }
.cspd { flex-direction: column; align-items: stretch; gap: 1px; }
.ctl input[type=range] { width: 100%; margin: 0; accent-color: var(--accent); }
.ctl select { background: #2a2e34; border: 1px solid #454b53; border-radius: 5px; color: #e8e8e8; font: 11px system-ui, sans-serif; height: 22px; max-width: 110px; }
.ctl .cbtns { display: flex; gap: 3px; }
.ctl .cbtns button { width: auto; flex: 1; font-size: 11px; }
.ctl .cbtns button.on { background: var(--accent); border-color: var(--accent); color: #001018; font-weight: 700; }
.ctl .cnow { margin: 0; font-size: 9.5px; line-height: 1.25; color: #8b949e; min-height: 2.5em; }
/* in the lesson view the controls sit below the map, in columns */
.dash.focus .ctl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 3px 12px; align-content: space-evenly; padding: 8px 12px; }
.dash.focus .crow { flex-direction: column; align-items: stretch; gap: 1px; }
.dash.focus .crow .cv { justify-content: space-between; }
.dash.focus .cbtns, .dash.focus .cnow { grid-column: 1 / -1; }
.dash.focus .cspd { grid-column: span 1; }
.dash.focus .cnow { min-height: 0; }

/* ---------- view from above (js/ifr/planmap.js), lesson view only ---------- */
.pmap { position: relative; width: 442px; height: 442px; border-radius: 10px; overflow: hidden; background: #0d1014; box-shadow: inset 0 0 0 1px #2b3036, 0 3px 6px #000a; }
.pmap canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.pmbtns { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.pmbtns button { width: 24px; height: 24px; border-radius: 6px; background: #1f2226e6; border: 1px solid #3a3f46; color: #e7e9ec; font: 700 15px/1 system-ui; padding: 0; }
.pmhelp { position: absolute; left: 10px; bottom: 6px; margin: 0; font: 11px/1.3 system-ui, sans-serif; color: #aab2bb; pointer-events: none; text-shadow: 0 0 3px #000, 0 0 3px #000; }

/* ---------- lessons in the slot beside the upper G5 (small), or the whole left column in the lesson view ---------- */
.tile .lesson { position: static; flex: none; width: 200px; height: 257px; max-height: none; min-width: 0; padding: 10px 12px; overflow-y: auto; scrollbar-width: thin;
  background: linear-gradient(#26292d, #1b1d20); border: 0; border-radius: 10px; box-shadow: inset 0 1px 0 #ffffff14, 0 3px 6px #000a; font: 10.5px/1.4 system-ui, sans-serif; }
.tile .lesson h2 { margin: 0 0 6px; font: 700 10px system-ui, sans-serif; letter-spacing: .07em; text-transform: uppercase; color: #8b949e; }
.tile .lhead span { font-size: 10px; }
.tile .lesson h3 { margin: 2px 0 4px; font-size: 12px; }
.tile .lesson .brief { margin: 0 0 6px; }
.tile .lesson .row { gap: 4px; margin: 6px 0; }
.tile .lesson .row button, .tile .lesson .xbtn { padding: 3px 7px; border-radius: 6px; font-size: 10px; }
.tile #outline { margin-top: 8px; padding-top: 6px; }
.tile #outline summary { padding: 2px 0; font-size: 10.5px; }
.tile .lsn { font-size: 10px; padding: 2px 4px; }
.tile .xuse img { width: 44px; height: 30px; }
.tile .xtag, .tile .xlab { font-size: 8.5px; }
.tile .opts button { padding: 4px 7px; font-size: 10px; }
.dash.focus .tile .lesson { font-size: 12.5px; padding: 12px 14px; display: flex; flex-direction: column; }
.dash.focus .tile .lesson .lhead { display: none; }
.dash.focus .tile .lesson h3 { font-size: 15px; }
.dash.focus .tile .lesson .row button, .dash.focus .tile .lesson .xbtn { padding: 5px 10px; font-size: 12px; }
.dash.focus .tile .xtag, .dash.focus .tile .xlab { font-size: 10px; }
.dash.focus .tile .opts button { padding: 6px 10px; font-size: 12.5px; }
.dash.focus .xuse img { width: 58px; height: 38px; }
.dash.focus #lessonBody { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dash.focus .xb { flex: 1; overflow-y: auto; scrollbar-width: thin; min-height: 0; }
.dash.focus .xrow { margin: 8px 0 0; }

/* ---------- round instruments drawn on canvas, knob hot spot bottom left ---------- */
.adfm { position: absolute; left: 42px; top: 203px; display: flex; gap: 3px; }
.adfm button { width: 36px; height: 18px; padding: 0; border-radius: 4px; border: 1px solid #000; background: linear-gradient(#4a4d52, #2c2e32); color: #cfd2d7; font: 700 9px Arial, sans-serif; }
.adfm button.on { background: linear-gradient(#ffd25e, #d59a1d); color: #1a1100; }

/* ---------- KR 87 ADF ---------- */
.kr87 { height: 58px; }
.krd { position: absolute; left: 12px; top: 7px; width: 252px; height: 27px; display: grid; grid-template-columns: 30px 1fr 28px 1fr; align-items: center; padding: 0 8px; background: linear-gradient(#0c0a07, #060504); border-radius: 3px; box-shadow: inset 0 1px 5px #000, 0 0 0 1px #000, 0 1px 0 #ffffff12; color: #ffb02e; font: 700 17px/1 "Arial Narrow", Arial, sans-serif; }
.krd span { font-size: 8px; letter-spacing: .04em; text-shadow: 0 0 5px #ffb02e77; }
.krd b { display: flex; justify-content: center; height: 19px; filter: drop-shadow(0 0 3px #ffa01e88); }
.kr87.off .krd { color: transparent; }
.kr87.off .krd span { text-shadow: none; }
.kr87.off .krd .seg { visibility: hidden; }
.krk { position: absolute; left: 12px; top: 37px; display: flex; gap: 5px; }
.kr87 button { height: 16px; min-width: 40px; border-radius: 3px; border: 1px solid #000; background: linear-gradient(#5f6266, #393b3e); color: #f2f2f2; font: 700 7px Arial, sans-serif; padding: 0 4px; box-shadow: 0 1px 0 #0009, inset 0 1px 0 #ffffff24; }
.kr87 button:active { transform: translateY(.5px); filter: brightness(1.2); }
.kr87 button.on { color: #ffd36b; }
.krpwr { position: absolute; left: 276px; top: 11px; }
.kr87 .rknob { top: 4px; right: 40px; }
.kr87 .rknob.small { top: 14px; right: 50px; }

/* ---------- DME and transponder: thin strips under the flight instruments ---------- */
.seg { display: block; height: 100%; width: auto; fill: currentColor; }
.seg .off { opacity: .055; }
.dme, .xpdr { width: 326px; height: 42px; }
.dmed { position: absolute; left: 8px; top: 6px; width: 212px; height: 30px; display: grid; grid-template-columns: 62px 18px 42px 16px 28px 20px; align-items: center; justify-items: end; gap: 0 2px; padding: 0 5px; background: linear-gradient(#090403, #050302); border-radius: 3px; box-shadow: inset 0 1px 5px #000, 0 0 0 1px #000; color: #ff5a32; }
.dmed b { height: 19px; filter: drop-shadow(0 0 3px #ff4a2299); }
.dmed span { font: 700 7px Arial, sans-serif; justify-self: start; color: #ff8a6a; }
.dmek { position: absolute; left: 226px; top: 6px; display: flex; flex-direction: column; gap: 2px; }
.dmek button, .xmodes button, .xpdr > button { height: 14px; min-width: 42px; border-radius: 3px; border: 1px solid #000; background: linear-gradient(#5f6266, #393b3e); color: #f2f2f2; font: 700 7px Arial, sans-serif; padding: 0 3px; }
.dmek button.on, .xmodes button.on { color: #ffd36b; }
.xr { position: absolute; left: 8px; top: 6px; width: 13px; height: 13px; border-radius: 50%; font: 700 8px/13px Arial; text-align: center; background: #2b2410; color: #6a5a20; }
.xr.lit { background: #ffc531; color: #1a1300; box-shadow: 0 0 6px #ffc531; }
.xcode { position: absolute; left: 26px; top: 6px; width: 88px; height: 30px; padding: 5px 8px; background: linear-gradient(#090503, #050302); border-radius: 3px; box-shadow: inset 0 1px 5px #000, 0 0 0 1px #000; color: #ffb02e; }
.xcode > div:first-child { height: 20px; filter: drop-shadow(0 0 3px #ffa01e88); }
.xpdr.off .xcode > div:first-child { visibility: hidden; }
.xhit { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.xhit i { cursor: ew-resize; touch-action: none; border-radius: 3px; }
.xhit i:hover { background: #ffffff14; }
.xfl { position: absolute; left: 118px; top: 24px; width: 40px; font: 700 7.5px Arial, sans-serif; color: #ffb02e; text-align: center; }
.xmodes { position: absolute; left: 118px; top: 5px; display: flex; gap: 1px; }
.xmodes button { min-width: 28px; }
.xpdr > button { position: absolute; left: 266px; top: 23px; min-width: 34px; background: linear-gradient(#e8e9ea, #a9abae); color: #111; }
.dme .plate, .xpdr .plate { bottom: 2px; right: 6px; }
