/* Author: Jesse Carpenter */
/* Website: carpentersoftware.com */
/* Page: AVR100 Simulator (In Development) */
/* Version: Carpenter Software 1.0.1 */
/* DATE: 20261130 */
/* 0.2.0: IDE layout (Build, Upload, Run, Stop, line numbers, Output */
/* and Serial Monitor tabs), focus outlines, larger touch targets, */
/* and the full letter g in the stamp. Components bar as a column at */
/* the left of the board on wide screens (760 pixels and wider), down */
/* to the IDE, with smaller controls when using a mouse. The */
/* Stop button sat beside Clear (removed in 0.3.2). A green */
/* Run LED beside Upload is lit while the sketch runs. Knob, light */
/* sensor, buzzer, RGB LED, Sound box, and the Serial Plotter. */
/* Stamp: a red double circle around it, like a rubber stamp, and */
/* "Desktop Use, Under Development". Top to bottom: the board, then */
/* the IDE, up to 1200 pixels wide; a 60 column breadboard; scroll */
/* bars always shown; the stamp in a red double rectangle with round */
/* corners. Compact sizes (see COMPACT at the end). The components */
/* column runs beside the board and the IDE; one IDE toolbar; code */
/* left, Serial Monitor and Plotter right; the power supply. The */
/* Plotter is always shown at the top right; the editor has a set size. */
/* 0.3.0: the multimeter buttons; the Examples menu with sub menus. */
/* 0.3.1: the editor, monitor, and plotter are fixed sizes with grips */
/* to make them taller. */
/* 0.3.2: the Run LED is steady ON while running, OFF otherwise; the */
/* Help and Reference links; the bold first Output line names the */
/* sketch; Build and Upload as symbols only, no Run or Stop button. */
/* 0.5.0: the Modules column at the right, beside the board and the */
/* IDE (three columns on wide screens); the Electronics Lab knob and */
/* buttons. */
/* 0.6.0: the Uno and Chip sketch tabs; the Microchip (Atmel) heading */
/* in the Modules column; the Uno's chip is a button. */
/* 0.7.0: the Modules column is gone (each module has an ON and OFF */
/* switch in its lab slot; the ATmega328P button is with Components */
/* and Clear Lab under Clear Board); the second IDE row of file tabs */
/* (fileTabs); Export and Open folder use the file button style. */
/* 1.0.0 (AVR100): the editor at the right of the bench, as wide as */
/* the bench, the Plotter, Output, and Serial Monitor under the bench */
/* (approved by Jesse Carpenter, Image-4); the code page white, in C */
/* and C++ colors (the code editor, CodeMirror 6); Hide Plotter. */
/* 1.0.1 (AVR101): side by side from 2100 pixels (from 1900 to 2010 */
/* the bench was cut off at its right); the editor 560 pixels tall */
/* under the bench; the editor's bar in two rows by purpose. */
/* Designed: Jesse Carpenter and Claude (Anthropic) */
/* LICENSE: MIT */

/************************* MAIN *********************************/

/* Background: circular gradation of a light Uno board teal */
/* (#00878F family), white at the edges, as on the calculator page */
main {
  padding: 0;
  color: #1b1f3a;
  text-align: left;
  background: radial-gradient(rgb(160, 218, 222) 15%, white 70%);
}

/* The page uses the width it is given, up to 1200 pixels */
.unoPage {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1.5rem;
  position: relative;
}

/************************* BUG STAMP ****************************/

/* A stamp in the upper right corner, inside the main bars. Laid */
/* out like the logo: picture on the left, the two lines of words */
/* on the right with their right edges aligned. About the size of */
/* the logo (300px wide). The header logo itself is not changed. */
/* A red double rectangle with round corners, like a rubber stamp */
.bugStamp {
  float: right;
  width: 300px;
  margin: 1.4rem 1.4rem 2.4rem 1rem;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  border: 4px solid #b3261e;
  border-radius: 18px;
  outline: 2px solid #b3261e;
  outline-offset: 4px;
  transform: rotate(15deg);
}

.bugStamp img {
  width: auto;
  height: 100px;
  flex: none;
}

.stampText {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: Verdana, Geneva, sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

/* Deep red gradient, like the blue gradient of the logo words */
/* The bottom padding keeps the tail of the g inside the clip */
.stampWord1,
.stampWord2 {
  padding: 0 0.04em 0.16em;
  margin-bottom: -0.16em;
  font-size: 2.05rem;
  background: linear-gradient(180deg, #e0463a 0%, #8e1410 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stampNote {
  margin-top: 3px;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: #8e1410;
  text-align: right;
  line-height: 1.25;
}

/* Below the title and bar, everything starts under the stamp */
.hint,
.simArea {
  clear: both;
}

/************************* TITLE ********************************/

.unoTitle {
  margin: 0.25rem 0 0.4rem;
  text-align: left;
  font-size: 1.5rem;
  color: #1d167b;
}

.unoIntro {
  margin: 0 0 1rem;
  text-align: left;
  font-size: 0.95rem;
}

/************************* COMPONENTS BAR ***********************/

.componentsBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(0, 135, 143, 0.4);
  border-radius: 10px;
  background: #ffffff;
}

.barLabel {
  font-weight: 700;
  color: #1d167b;
  margin-right: 4px;
}

.barSpacer {
  flex: 1;
}

.toolGroup {
  display: flex;
  align-items: center;
  gap: 4px;
}

button,
select {
  font: inherit;
  font-size: 0.9rem;
  touch-action: manipulation;
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  border: 2px solid #3a79f7;
  border-radius: 8px;
  color: #1d167b;
  background: #eef3ff;
  cursor: pointer;
}

.tool svg {
  width: 28px;
  height: 18px;
}

.tool.plain.active {
  color: #ffffff;
  background: #b3261e;
  border-color: #b3261e;
}

.tool.active {
  color: #ffffff;
  background: #3a79f7;
}

.tool.plain,
.plain {
  border: 2px solid #888;
  border-radius: 8px;
  background: #f4f4f4;
  color: #333;
  cursor: pointer;
}

.small {
  min-height: 28px;
  padding: 2px 8px;
  font-size: 0.8rem;
}

select {
  min-height: 36px;
  border: 1px solid #999;
  border-radius: 6px;
  background: #ffffff;
}

.hint {
  margin: 6px 2px 8px;
  font-size: 0.85rem;
  color: #4a4f6a;
}

/************************* WORKSPACE ****************************/

/* Wide enough to tap the holes on a phone; scrolls sideways */
/* The board keeps a usable size; narrower, it scrolls sideways */
.workspace {
  overflow-x: scroll;
  border-radius: 10px;
  background: #f4fbfb;
  border: 1px solid rgba(0, 135, 143, 0.35);
}

#bench {
  display: block;
  width: 100%;
  min-width: 820px;
  height: auto;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#bench .hit {
  fill: transparent;
  cursor: pointer;
}

/* The visible hole sits on top; taps pass through to the target */
#bench .hole {
  pointer-events: none;
}

#bench .hit:hover + .hole,
#bench .hole.pick {
  fill: #3a79f7;
}

#bench .part {
  cursor: pointer;
}

.warnings {
  margin: 8px 0 0;
  padding-left: 1.2rem;
  color: #b3261e;
  font-size: 0.85rem;
}

/************************* IDE **********************************/

/* Laid out like the Arduino IDE: toolbar, sketch tab, editor with */
/* line numbers, and Output and Serial Monitor tabs at the bottom */
/* Overflow stays visible so the Examples menu can open over the */
/* code; the bar and the body round their own corners */
.ide {
  margin: 14px 0 0;
  border: 1px solid #0b5d61;
  border-radius: 10px;
  background: #1f2433;
}

.ideBar {
  border-radius: 9px 9px 0 0;
}

.ideBody {
  overflow: hidden;
  border-radius: 0 0 9px 9px;
}

.ideBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #005c5f;
}

.ideBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 14px 4px 6px;
  border: none;
  border-radius: 20px;
  color: #ffffff;
  background: #00878f;
  font-weight: 700;
  cursor: pointer;
}

.ideBtn svg {
  width: 28px;
  height: 28px;
  padding: 3px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #ffffff;
  fill: none;
  stroke: #00878f;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ideBtn svg .fill {
  fill: #00878f;
  stroke: none;
}

/* Build and Upload show only their symbols, as in the Arduino IDE */
.ideBtn.icon {
  justify-content: center;
  width: 40px;
  padding: 4px;
}

.ideBtn:hover {
  filter: brightness(1.12);
}

.ideBtn:disabled {
  opacity: 0.45;
  cursor: default;
  filter: none;
}

/* Run LED beside Upload: dark when stopped, steady green while the */
/* sketch runs */
.runLed {
  width: 14px;
  height: 14px;
  margin: 0 4px;
  border-radius: 50%;
  background: #1d4d33;
  border: 2px solid #0a2a1a;
}

/* Lit while running (no flashing) */
.runLed.on {
  background: #3ddc6b;
  box-shadow: 0 0 8px 2px #3ddc6b;
}

.ideState {
  margin-left: auto;
  color: #d8f3f4;
  font-size: 0.85rem;
}

.ideState b {
  color: #ffffff;
}

.ideBar select,
.fileBtn {
  min-height: 34px;
  border: 1px solid #7fc4c8;
  border-radius: 6px;
  color: #ffffff;
  background: #0b5d61;
  font-size: 0.85rem;
  cursor: pointer;
}

.ideBar select {
  width: 160px;
  padding: 0 6px;
}

.fileBtn {
  padding: 2px 9px;
}

.fileBtn.small {
  min-height: 28px;
  margin-bottom: 4px;
  padding: 0 10px;
}

.wireIt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d8f3f4;
  font-size: 0.85rem;
  cursor: pointer;
}

.wireIt input {
  width: 20px;
  height: 20px;
}

.ideTab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: #2a3042;
  color: #ffffff;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.sketchTab {
  padding: 3px 12px;
  border: 1px solid #4a5470;
  border-radius: 5px 5px 0 0;
  background: #3a425a;
  color: #c9d0e0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sketchTab.active {
  background: #f4f6fb;
  color: #1d2433;
  border-color: #f4f6fb;
}

.sketchTab:focus-visible {
  outline: 3px solid #ffb000;
}

.barLabel.subLabel {
  font-size: 0.85rem;
}

/* The second row: the files of the sketch (UB70) */
.fileTabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 3px 2px;
  padding: 4px 12px 0;
  background: #1f2433;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.fileTab {
  display: inline-flex;
  align-items: center;
  border: 1px solid #3a425a;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: #2a3042;
  color: #c9d0e0;
}

.fileTab.active {
  background: #f4f6fb;
  color: #1d2433;
}

.fileTab.error {
  background: #8b2323;
  color: #ffffff;
}

.fileTab button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.fileName {
  padding: 3px 10px;
}

.fileTab.active .fileName {
  font-weight: 700;
}

.fileMenu {
  padding: 3px 7px 3px 0;
  opacity: 0.7;
}

.fileDot {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #ffcf6e;
}

.fileAdd {
  margin: 0 0 3px 6px;
  padding: 1px 9px;
  border: 1px solid #4a5470;
  border-radius: 5px;
  background: #3a425a;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.fileTab button:focus-visible,
.fileAdd:focus-visible {
  outline: 3px solid #ffb000;
}

.changed {
  color: #ffcf6e;
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
}

.editor {
  display: flex;
  background: #1f2433;
}

/* The extra bottom padding lets the numbers scroll as far as the code, */
/* whose horizontal scroll bar takes room at the bottom */
.gutter {
  flex: none;
  min-width: 2.6em;
  margin: 0;
  padding: 10px 8px 40px 4px;
  overflow: hidden;
  text-align: right;
  color: #6d7590;
  background: #191d29;
  font-family: Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.4;
  user-select: none;
}

.gutter .errLine {
  color: #ffffff;
  background: #b3261e;
  border-radius: 3px;
  padding: 0 2px;
}

#code {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: none;
  outline: none;
  resize: none;
  overflow: scroll;
  white-space: pre;
  font-family: Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.4;
  color: #e8ecff;
  background: #1f2433;
  tab-size: 2;
}

.panelTabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 0;
  background: #2a3042;
}

.ptab {
  white-space: nowrap;
  min-height: 34px;
  padding: 4px 14px;
  border: none;
  border-radius: 6px 6px 0 0;
  color: #b9c0d6;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.ptab.active {
  color: #ffffff;
  background: #10141f;
}

.panel {
  height: 150px;
  overflow-y: auto;
  margin: 0;
  padding: 8px 12px;
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
  color: #cfd6ea;
  background: #10141f;
}

.panel.serial {
  color: #9fffa8;
  white-space: pre-wrap;
}

.panel .err {
  color: #ff8a80;
}

/* First Output line of a Build or Upload: the sketch name */
.panel .head {
  color: #ffffff;
  font-weight: 700;
}

/* Help and Reference: links that look like the file buttons */
a.fileBtn {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  text-decoration: none;
}

/* Keyboard users see where they are (WCAG 2.4.7 and 2.4.11) */
button:focus-visible,
select:focus-visible,
input:focus-visible,
#code:focus-visible,
.usbJack:focus-visible,
.resetBtn:focus-visible {
  outline: 3px solid #ffb000;
  outline-offset: 2px;
}

/* Touch screens: controls at least 44 by 44 pixels (WCAG 2.5.5) */
@media (pointer: coarse) {
  .tool,
  select,
  .fileBtn,
  .ptab,
  .ideBtn {
    min-height: 44px;
  }
}

/* The USB jack and reset button are buttons on the board */
#bench .usbJack,
#bench .resetBtn {
  cursor: pointer;
}

/************************* MORE COMPONENTS **********************/

.soundBox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #1d167b;
  cursor: pointer;
}

/* Knob and light sensor: drag to change them */
#bench .part.adjust {
  cursor: ew-resize;
}

/* Buzzer rings pulse while it plays a note */
#bench .buzzRings {
  animation: buzzPulse 0.5s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes buzzPulse {
  from {
    opacity: 1;
    transform: scale(0.8);
  }
  to {
    opacity: 0;
    transform: scale(1.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  #bench .buzzRings {
    animation: none;
  }
}

/************************* SERIAL PLOTTER ***********************/

.plotter {
  border-top: 2px solid #2a3042;
  background: #10141f;
}

.plotHead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 10px 2px;
  color: #e8ecff;
  font-size: 0.85rem;
}

.plotTitle {
  font-weight: 700;
}

.plotLegend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
}

.plotKey {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.plotKey i {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
}

#plotCanvas {
  display: block;
  width: 100%;
  height: 240px;
}

/************************* SCROLL BARS **************************/

/* Scroll bars always shown, so a narrow window shows that the page */
/* and the board scroll (Chrome, Edge, and Safari) */
html {
  overflow-y: scroll;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #e3eeef;
}

::-webkit-scrollbar-thumb {
  border: 2px solid #e3eeef;
  border-radius: 6px;
  background: #7aa9ad;
}

.ide ::-webkit-scrollbar-track {
  background: #1f2433;
}

.ide ::-webkit-scrollbar-thumb {
  border-color: #1f2433;
  background: #4d5873;
}

/************************* WIDE SCREENS *************************/

/* The components bar becomes a column at the left of the board, */
/* and stays in view while the board scrolls */
@media screen and (min-width: 760px) {
  .simArea {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
  }

  /* The column runs down beside the board and the IDE */
  .componentsBar {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .toolGroup {
    flex-direction: column;
    align-items: stretch;
  }

  .componentsBar .tool {
    justify-content: flex-start;
  }

  .barLabel {
    margin: 0 0 2px;
  }

  .componentsBar .barSpacer {
    flex: none;
    height: 6px;
  }
}

/* With a mouse, smaller controls leave room for more components; */
/* touch screens keep the 44 pixel targets */
@media screen and (min-width: 760px) and (pointer: fine) {
  .componentsBar .tool,
  .componentsBar select {
    min-height: 28px;
    padding-top: 2px;
    padding-bottom: 2px;
    font-size: 0.85rem;
  }

  .componentsBar .tool svg {
    height: 14px;
  }
}

/************************* NOTES ********************************/

.about {
  margin: 14px 0 0;
  font-size: 0.88rem;
}

.about summary {
  cursor: pointer;
  font-weight: 700;
  color: #1d167b;
}

.credit,
.trademark {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: #4a4f6a;
}

/************************* PHONES *******************************/

@media screen and (max-width: 420px) {
  .bugStamp {
    float: none;
    width: 240px;
    margin: 1.6rem 0.5rem 1.6rem auto;
  }

  .bugStamp img {
    height: 80px;
  }

  .stampWord1,
  .stampWord2 {
    font-size: 1.6rem;
  }

  .stampNote {
    font-size: 0.5rem;
  }

  .unoTitle {
    font-size: 1.25rem;
  }
}

/************************* COMPACT ******************************/

/* Smaller stamp, title, bars, and panels so more fits on a screen */
/* The tilted corners reach past the box; the bottom margin keeps */
/* them clear of the board */
.bugStamp {
  width: 230px;
  margin: 0.6rem 1rem 2.2rem 1rem;
  padding: 6px 10px;
  border-width: 3px;
  border-radius: 14px;
  outline-offset: 3px;
}

.bugStamp img {
  height: 70px;
}

.stampWord1,
.stampWord2 {
  font-size: 1.5rem;
}

.stampNote {
  font-size: 0.5rem;
}

.unoTitle {
  margin: 0.2rem 0 0.2rem;
  font-size: 1.35rem;
}

.unoIntro {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
}

.hint {
  margin: 4px 2px 6px;
}

.componentsBar {
  gap: 5px;
  padding: 6px;
}

.ide {
  margin-top: 10px;
}

.ideBar {
  padding-top: 5px;
  padding-bottom: 5px;
}

.ideBtn {
  min-height: 34px;
}

.ideBtn svg {
  width: 24px;
  height: 24px;
}

/* Fixed at 400 pixels; the code scrolls (scroll bar or mouse wheel). */
/* The grip in the lower right corner makes it taller or shorter. */
.editor {
  height: 560px;
  min-height: 200px;
  resize: vertical;
  overflow: hidden;
}

.panel {
  height: 110px;
}

#plotCanvas {
  height: 170px;
}

@media screen and (min-width: 760px) {
  .componentsBar .tool {
    white-space: nowrap;
  }
}

/* The hint sits at the bottom of the components column */
.componentsBar .hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
}

.ide {
  margin-top: 8px;
}

/************************* IDE: CODE LEFT, MONITOR RIGHT ********/

/* The code on the left (80 character lines); Output, the Serial */
/* Monitor, and the Plotter stacked on the right */
.ideBody {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

.ideRight {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 2px solid #2a3042;
  background: #10141f;
}

.ideRight .panelTabs {
  flex: none;
}

/* Output and Serial Monitor: fixed, with a grip to make them taller */
.ideRight .panel {
  flex: none;
  height: 200px;
  min-height: 100px;
  resize: vertical;
  overflow-y: scroll;
}

/* Serial Plotter: fixed, with a grip; the graph fills it */
.ideRight .plotter {
  flex: none;
  display: flex;
  flex-direction: column;
  height: 205px;
  min-height: 135px;
  resize: vertical;
  overflow: hidden;
}

.ideRight .plotter #plotCanvas {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

/* The code and the monitor column keep their own heights */
.ideBody {
  align-items: start;
}

/* Windows under 1200 pixels: the plotter and monitor below the code, */
/* so their buttons are not cut off */
@media screen and (max-width: 1199px) {
  .ideBody {
    grid-template-columns: minmax(0, 1fr);
  }

  .ideRight .panel {
    height: 160px;
  }

  .editor {
    height: 300px;
  }
}

/************************* POWER SUPPLY *************************/

#bench .busBtn {
  cursor: pointer;
}

#bench .busBtn:hover rect {
  stroke: #ffb000;
  stroke-width: 2;
}

#bench .meterBtn {
  cursor: pointer;
}

#bench .meterBtn:focus-visible,
#bench .busBtn:focus-visible {
  outline: 3px solid #ffb000;
}

/************************* ELECTRONICS LAB **********************/

#bench .labKnob {
  cursor: grab;
}

#bench .labKnob:active {
  cursor: grabbing;
}

#bench .labBtn,
#bench .unoChipBtn {
  cursor: pointer;
}

#bench .unoChipBtn:focus-visible {
  outline: 3px solid #ffb000;
}

#bench .labKnob:focus-visible,
#bench .labBtn:focus-visible {
  outline: 3px solid #ffb000;
}

/************************* EXAMPLES MENU ************************/

.menuWrap {
  position: relative;
  display: inline-block;
}

.menuBtn {
  min-width: 120px;
  text-align: left;
}

/* The menu and each sub menu: a list of white buttons */
.exampleMenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
}

.menuList {
  margin: 0;
  padding: 4px 0;
  list-style: none;
  min-width: 200px;
  border: 1px solid #0b5d61;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.menuList li {
  position: relative;
}

.menuList button {
  display: block;
  width: 100%;
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: #1b1f3a;
  font-size: 0.85rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.menuList button:hover,
.menuList button:focus-visible {
  background: #e3f2f3;
  outline: none;
}

/* A sub menu opens to the right of its group, on hover or focus */
.hasSub > button::after {
  content: "\25B8";
  float: right;
  margin-left: 12px;
  color: #00878f;
}

.hasSub > .menuList {
  display: none;
  position: absolute;
  top: -5px;
  left: 100%;
}

.hasSub:hover > .menuList,
.hasSub:focus-within > .menuList {
  display: block;
}

/************************* AVR100: EDITOR RIGHT *****************/

/* The code page: the code editor (CodeMirror 6) fills its panel; */
/* its white page and colors are set in unoEditor.js */
.editor {
  background: #ffffff;
}

.editor .cm-editor {
  flex: 1;
  min-width: 0;
  height: 100%;
}

.editor .cm-editor.cm-focused {
  outline: 2px solid #00979d;
  outline-offset: -2px;
}

/* The Plotter, Output, and Serial Monitor under the bench */
.benchCol .monitors {
  margin-top: 10px;
  border: 1px solid #0b5d61;
  border-left: 1px solid #0b5d61;
  border-radius: 10px;
  overflow: hidden;
}

/* The editor fills its column; it has only the code now */
.simMain .ideBody {
  display: block;
}

/* The editor's code fills the width of its frame */
.simMain .ideBody {
  align-items: stretch;
}

.simMain .ideLeft {
  width: 100%;
}

/* Wide windows (2100 pixels: the bench's 820 pixels fit in each half */
/* with the components column and the margins; from 1900 to 2010 they */
/* did not, and the bench was cut off): the bench and the editor side */
/* by side, equal widths. Narrower windows: the editor under the bench, */
/* as wide as the bench */
@media screen and (min-width: 2100px) {
  .unoPage {
    max-width: 2600px;
  }

  .simMain {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
  }

  .simMain .ide {
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  .simMain .ideBody,
  .simMain .ideLeft {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .simMain .ideLeft .editor {
    flex: 1 1 auto;
    height: auto;
    min-height: 400px;
    resize: none;
  }
}

/* Hide Plotter: Output and the Serial Monitor take the Plotter's room */
/* (its 205 pixels and their own 200) */
.monitors.noPlot .panel {
  height: 405px;
}

.monitors .plotter[hidden] {
  display: none;
}

/* AVR101: the editor's bar in two rows by purpose: build, examples, */
/* help, and the state on row 1; the files on row 2 */
.ideBar .barBreak {
  flex-basis: 100%;
  height: 0;
}
