/* The patch viewer. Same terminal as the receiver, laid out as a file list and
   a pane, because that is what reading source looks like. */

#page.wide { max-width: 1120px; }

#pv {
  display: flex; gap: 0; align-items: stretch;
  border: 1px solid var(--line); margin: 18px 0 20px 0; min-height: 60vh;
}

/* --- the file list -------------------------------------------------------- */
#pvlist {
  width: 244px; flex: 0 0 244px;
  border-right: 1px solid var(--line);
  overflow-y: auto; max-height: 78vh;
}
#pvlist .grp {
  padding: 8px 12px 4px 12px; color: var(--dimmer);
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  border-bottom: 1px solid var(--line2);
}
#pvlist a {
  display: block; padding: 7px 12px; border: 0; border-bottom: 1px solid var(--line2);
  color: var(--dim); text-decoration: none;
}
#pvlist a:hover { background: var(--panel2); color: var(--bright); }
#pvlist a.on { background: var(--panel); color: var(--green); border-left: 2px solid var(--green2); padding-left: 10px; }
#pvlist .d { color: var(--fg); }
#pvlist a.on .d { color: var(--green); }
#pvlist .n { display: block; font-size: 11px; color: var(--dimmer); margin-top: 1px; }
#pvlist a.on .n { color: var(--dim); }

/* --- the pane ------------------------------------------------------------- */
#pvmain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
#pvhead {
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 11px; color: var(--dim);
}
#pvname { color: var(--bright); }
#pvmeta a { color: var(--dim); }

#pvcode {
  margin: 0; padding: 12px 0; overflow: auto; flex: 1 1 auto;
  max-height: 72vh; background: var(--panel2);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  white-space: pre; tab-size: 4;
}
#pvcode:focus-visible { outline: 1px solid var(--green2); outline-offset: -1px; }
#pvcode code { display: block; }

/* line numbers, as a gutter that does not get selected with the code */
#pvcode .ln {
  display: inline-block; width: 3.4em; padding-right: 1em; margin-right: 1em;
  text-align: right; color: #2c3630; border-right: 1px solid var(--line2);
  user-select: none; -webkit-user-select: none;
}
#pvcode .row { display: block; }
#pvcode .row:hover { background: #121a15; }

/* the language: comments, statements, module kinds, numbers, buses */
#pvcode .c  { color: #55645180; }
#pvcode .c  { color: #5c6b57; }
#pvcode .k  { color: var(--amber); }
#pvcode .m  { color: var(--green); }
#pvcode .n  { color: #8fb0c4; }
#pvcode .s  { color: #b08fc4; }
#pvcode .ar { color: var(--dimmer); }

#foot code { color: var(--dim); }

@media (max-width: 760px) {
  #pv { display: block; border-left: 0; border-right: 0; }
  #pvlist { width: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; }
  #pvcode { max-height: none; font-size: 11px; }
  #pvcode .ln { width: 2.6em; padding-right: .6em; margin-right: .6em; }
}
