/* Shared by the playground (index.html) and the debugger (debugger.html).
   Each page keeps its own layout -- the body and main grids -- in its own
   <style>. */
  :root {
      color-scheme: light dark;
      --pad: 12px;
      --line: color-mix(in srgb, currentColor 18%, transparent);
      --faint: color-mix(in srgb, currentColor 8%, transparent);
  }
  * { box-sizing: border-box; }

  header, footer {
      padding: 6px var(--pad); font-size: 12px; opacity: .75;
      display: flex; gap: 1em; align-items: center; flex-wrap: wrap;
  }
  header { border-bottom: 1px solid var(--line); }
  footer { border-top: 1px solid var(--line); }

  /* The toolbar wraps. It had thirteen controls in a single non-wrapping
     row, so on any window narrower than the sum of them the select sat on
     top of its neighbours. */
  .bar {
      padding: 6px var(--pad); display: flex; gap: 6px 10px;
      align-items: center; flex-wrap: wrap;
      border-bottom: 1px solid var(--line);
  }
  .group { display: flex; gap: 6px; align-items: center; }
  .group + .group { padding-left: 10px; border-left: 1px solid var(--line); }
  .spacer { flex: 1 1 auto; }

  .pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
  .pane + .pane { border-left: 1px solid var(--line); }
  .pane > h2 {
      margin: 0; padding: 4px var(--pad); font-size: 11px; font-weight: 600;
      letter-spacing: .04em; text-transform: uppercase; opacity: .55;
      background: var(--faint); display: flex; gap: 8px; align-items: center;
      flex-wrap: wrap;
  }
  .pane > .body { flex: 1 1 auto; min-height: 0; overflow: auto; }

  #src {
      width: 100%; height: calc(100% - 1.4em); margin: 0; padding: var(--pad);
      border: 0; outline: none; resize: none; display: block;
      font: inherit; background: transparent; color: inherit;
      white-space: pre; overflow: auto;
  }
  #complete {
    font: 12px/1.4 ui-monospace, Menlo, monospace;
    opacity: .8; min-height: 1.4em; white-space: pre-wrap;
    padding: 0 var(--pad);
  }

  /* Which registers to show. /_x holds every binding in the VM -- about ten
     kilobytes -- so it is off by default; its size is on the chip whether it
     is shown or not. */
  .chips { display: flex; gap: 4px; flex-wrap: wrap; }
  .chip {
      font: inherit; font-size: 11px; padding: 1px 6px; cursor: pointer;
      border: 1px solid var(--line); border-radius: 10px;
      background: transparent; color: inherit; opacity: .55;
  }
  .chip[aria-pressed="true"] { opacity: 1; background: var(--faint);
      border-color: color-mix(in srgb, currentColor 45%, transparent); }
  .chip .n { opacity: .5; margin-left: 4px; }

  #regs { display: flex; flex-direction: column; }
  .reg { border-bottom: 1px solid var(--faint); padding: 6px var(--pad); }
  .reg h4 { margin: 0 0 2px; font-size: 11px; opacity: .55; font-weight: 600;
      display: flex; justify-content: space-between; }
  .reg pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
  .reg.hot h4 { opacity: 1; color: #2a2; }
  .reg pre.hex { white-space: pre; overflow-x: auto; font-size: 11px; opacity: .8; }
  .empty { opacity: .4; }

  #out {
      margin: 0; padding: var(--pad); font: inherit; white-space: pre-wrap;
      overflow: auto; height: 100%;
  }

  button, input, select { font: inherit; }
  .dot { width: 8px; height: 8px; border-radius: 50%; background: #999;
      display: inline-block; }
  .dot.on { background: #2c2; }
  .err { color: #c33; }

/* The tree view. <details>/<summary> gives the disclosure triangle, so the
   open/closed state belongs to the element and survives a re-render of a
   sibling. */
.tree { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.tree details { margin-left: .9em; }
.tree > details { margin-left: 0; }
.tree summary { cursor: pointer; opacity: .85; }
.tree summary:hover { opacity: 1; }
.tree-leaf { margin-left: 2.1em; display: flex; gap: .6em; align-items: baseline; }
.tree-type { opacity: .55; min-width: 5.5em; }
.tree-value { font: inherit; }
input.tree-value { background: #0003; border: 1px solid #fff2;
                   border-radius: 3px; color: inherit; padding: 0 .3em; }
input.tree-value:focus { border-color: #fff6; outline: none; }
input.tree-bad { border-color: #f66; }
.tree-fixed { opacity: .8; }
.tree-bar { display: flex; gap: .6em; align-items: center; margin: .3em 0 .5em; }
.tree-note { opacity: .7; font-size: 11px; }
/* The repair the fault suggests. Every repair stays available; this one
   is only marked. */
button.suggest { outline: 2px solid var(--accent, #2a7); outline-offset: 1px; }
.tree-err { color: #f99; margin-bottom: .4em; }

/* Snippets and the nodes they are dragged onto. */
.drop.over { outline: 1px dashed currentColor; }
#nodesevery { border: 1px dashed var(--line); border-radius: 10px; padding: 0 6px;
              text-transform: none; }
.node { margin: 0 0 8px; padding: 2px 4px; border-radius: 4px; }
.node .put { font-size: 10px; margin-left: 8px; }
.loop { display: inline-block; cursor: grab; border: 1px solid var(--line);
        border-radius: 10px; padding: 0 2px 0 6px; margin: 0 4px 2px 0; }
.loop button { font-size: 10px; border: 0; background: transparent; color: inherit;
               cursor: pointer; }
.snippet { padding: 2px var(--pad); cursor: grab; border-bottom: 1px solid var(--line); }
.snippet.chosen { background: var(--faint); }
.snippet pre { margin: 0; opacity: .8; white-space: pre-wrap; }
