/* AVR course: board, parts, controls, serial monitor (runner-avr.js). */
.ml-avr-demo { margin: 14px 0; }
.ml-avr-demo > pre { margin-bottom: 8px; }
.ml-avr-panel { margin: 10px 0 4px; }
.ml-avr-board {
	position: relative; overflow: hidden; border-radius: 14px;
	border: 1px solid var(--ml-border, rgba(0,0,0,.12));
	background-color: #eef2f5;
	background-image: radial-gradient(rgba(15,23,42,.13) 1px, transparent 1.2px);
	background-size: 12px 12px;
}
html[data-theme="dark"] .ml-avr-board { background-color: #1b2430; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1.2px); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .ml-avr-board { background-color: #1b2430; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1.2px); } }
.ml-avr-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.ml-avr-part { position: absolute; }
.ml-avr-wires { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
.ml-avr-wires polyline, .ml-avr-wires path { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; opacity: .92; }
.ml-avr-label { unicode-bidi: plaintext; position: absolute; font: 700 12px/1.2 ui-monospace, Consolas, monospace; color: #334155; white-space: nowrap; }
.ml-avr-label.is-small { font-size: 10px; font-weight: 600; color: #64748b; }
.ml-avr-caption { position: absolute; font: 600 10px/1 ui-monospace, Consolas, monospace; color: #475569; white-space: nowrap; }
html[data-theme="dark"] .ml-avr-label, html[data-theme="dark"] .ml-avr-caption { color: #cbd5e1; }
html[data-theme="dark"] .ml-avr-custom { color: #e2e8f0; }
.ml-avr-custom { color: #1f2937; line-height: 0; }
.ml-avr-slider { position: absolute; display: flex; align-items: center; gap: 4px; font: 600 11px ui-monospace, Consolas, monospace; color: #334155; background: rgba(255,255,255,.85); border-radius: 8px; padding: 2px 6px; }
.ml-avr-slider input { width: 74px; }
html[data-theme="dark"] .ml-avr-slider { background: rgba(15,23,42,.85); color: #e2e8f0; }
.ml-avr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.ml-avr-bar .ml-btn { padding: 6px 14px; }
.ml-avr-state { font-size: .85em; color: var(--ml-text-muted, #64748b); }
.ml-avr-time { margin-inline-start: auto; font: 600 12px ui-monospace, Consolas, monospace; color: var(--ml-text-muted, #64748b); }
.ml-avr-panel.is-running .ml-avr-board { box-shadow: 0 0 0 2px rgba(22,163,74,.45); }
.ml-avr-msg { margin-top: 8px; padding: 10px 12px; border-radius: 10px; font-size: .92em; background: rgba(100,116,139,.1); }
.ml-avr-msg.is-bad { background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.25); }
.ml-avr-msg.is-warn { background: rgba(202,138,4,.08); border: 1px solid rgba(202,138,4,.25); }
.ml-avr-msg strong { display: block; margin-bottom: 4px; }
.ml-avr-errors { margin: 0; padding-inline-start: 18px; }
.ml-avr-errors li { margin: 4px 0; }
.ml-avr-errors code { font-size: .9em; }
.ml-avr-errors span { display: block; color: var(--ml-text-muted, #64748b); font-size: .92em; }
.ml-avr-log { white-space: pre-wrap; font-size: 12px; max-height: 180px; overflow: auto; }
.ml-avr-serial { margin-top: 8px; border-radius: 10px; overflow: hidden; border: 1px solid var(--ml-border, rgba(0,0,0,.12)); }
.ml-avr-serial-head { font-size: 12px; font-weight: 700; padding: 5px 10px; background: rgba(100,116,139,.12); }
.ml-avr-serial pre { margin: 0; padding: 8px 10px; min-height: 2.4em; max-height: 170px; overflow: auto; background: #0f172a; color: #a7f3d0; font: 12.5px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.ml-avr-serial-in { display: flex; gap: 6px; padding: 6px; background: rgba(100,116,139,.08); }
.ml-avr-serial-in input { flex: 1; min-width: 0; font: 13px ui-monospace, Consolas, monospace; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--ml-border-strong, #cbd5e1); background: var(--ml-surface-sunken, #fff); color: var(--ml-text, #0f172a); }
.ml-avr-ex-board { margin-top: 10px; }
.ml-avr-edstate { font-size: .85em; opacity: .8; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .ml-avr-label, html:not([data-theme="light"]) .ml-avr-caption { color: #cbd5e1; } html:not([data-theme="light"]) .ml-avr-custom { color: #e2e8f0; } }
.ml-avr-panel [hidden] { display: none !important; }
/* breadboard circuits: jumpers lie on the board, parts stand above them */
.ml-avr-board.is-bb .ml-avr-part { z-index: 2; }
.ml-avr-board.is-bb .ml-avr-breadboard { z-index: 0; }
.ml-avr-board.is-bb .ml-avr-wires { z-index: 1; }
.ml-avr-board.is-bb .ml-avr-caption { color: #334155 !important; }
.ml-avr-board.is-bb .ml-avr-atmega328p, .ml-avr-board.is-bb .ml-avr-hc595, .ml-avr-board.is-bb .ml-avr-eeprom24 { z-index: 0; }
/* the full-screen view of a drawing (the ⤢ button) */
.ml-avr-board { position: relative; }
.ml-avr-sizer { position: relative; }
.ml-avr-zoom { position: absolute; top: 6px; left: 6px; z-index: 5; width: 32px; height: 32px; border-radius: 8px; border: 1px solid #475569; background: rgba(15, 23, 42, .78); color: #f8fafc; font: 700 17px/1 system-ui, sans-serif; cursor: pointer; padding: 0; }
.ml-avr-zoom:hover, .ml-avr-zoom:focus-visible { background: #0f172a; outline: 2px solid #38bdf8; outline-offset: 1px; }
.ml-avr-board.is-full { position: fixed; inset: 0; z-index: 100000; overflow: auto; background: #1c2330; padding: 48px 8px 8px; border-radius: 0; margin: 0; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; }
.ml-avr-board.is-full .ml-avr-zoom { position: fixed; top: 8px; left: 8px; width: 40px; height: 40px; }
html.ml-avr-noscroll, html.ml-avr-noscroll body { overflow: hidden; }
