:root { color-scheme: dark; font: 14px system-ui,sans-serif; background: #141b29; color: #eaf1fa; }
body { margin: 0; }
header,.toolbar,.editor-fields { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
header { padding: 10px 16px; }
a { color: #a9d4ff; }
button,.button,select,input { font: inherit; }
button,.button { background: #304d6a; color: white; border: 1px solid #6282a0; border-radius: 4px; padding: 6px 10px; cursor: pointer; }
input[type=file] { max-width: 180px; }
#canvas { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; border: 0; padding: 0; background: black; }
#stage:fullscreen { display: flex; align-items: center; justify-content: center; background: #141b29; }
#stage:fullscreen #canvas { max-width: min(100vw,177.77777778vh); max-height: 100vh; }
dialog { width: min(1050px,92vw); border: 1px solid #6282a0; border-radius: 8px; background: #1b283b; }
dialog::backdrop { background: #0009; }
h2 { margin-top: 0; }
.editor-fields { margin: 12px 0; }
.editor-fields label { display: flex; gap: 8px; }
.source-area { display: flex; height: min(48vh,520px); background: #0c1524; border: 1px solid #6282a0; }
#source,#line-numbers { font: 15px/22px monospace; margin: 0; padding: 8px; border: 0; }
#source { flex: 1; min-width: 0; resize: none; color: #edf3fb; background: transparent; tab-size: 4; }
#line-numbers { color: #8298b3; text-align: right; overflow: hidden; min-width: 3em; }
#editor-message { color: #ffda9d; min-height: 1.4em; }
#robot-log { white-space: pre-wrap; max-height: 180px; overflow: auto; }

#tutorial-guide { background: #19283b; border: 1px solid #ffdc41; padding: .65rem; margin-bottom: .7rem; }
#tutorial-guide p { white-space: pre-line; margin: .5rem 0; }
#tutorial-guide button { padding: .2rem .6rem; }
#tutorial-guide [data-tutorial-action="3"] { float: right; }
.tutorial-target { outline: 3px solid #ffdc41; outline-offset: 3px; }
