:root {
  color-scheme: light;
  --paper: #f3f4ef;
  --white: #ffffff;
  --ink: #171812;
  --quiet: #62675e;
  --rule: #cdd2ca;
  --red: #d43d2d;
  --blue: #1f5fbf;
  --green: #08746f;
  --yellow: #f2bb32;
  --touch: 46px;
  font-family: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
}

button,
input,
select,
a {
  font: inherit;
  letter-spacing: 0;
}

button,
input,
select {
  min-height: var(--touch);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
  background: var(--white);
}

button {
  cursor: pointer;
  font-weight: 700;
}

button:hover,
a:hover {
  border-color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.radio {
  width: min(100%, 1560px);
  min-height: 100vh;
  margin-inline: auto;
  background: var(--white);
}

.masthead {
  min-height: 122px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--ink);
}

.identity {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.release {
  margin: 0;
  color: var(--red);
  font: 800 0.7rem/1.2 ui-monospace, "Cascadia Mono", monospace;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 2.55rem;
  line-height: 1;
  font-weight: 800;
}

.identity > p:last-child {
  margin: 0;
  color: var(--quiet);
}

.money {
  display: flex;
  align-items: center;
  gap: 8px;
}

.money a {
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--green);
  border-radius: 4px;
  color: var(--white);
  background: var(--green);
  text-decoration: none;
  font-weight: 700;
}

.air {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  grid-template-areas:
    "transport transport"
    "now hit"
    "scope scope";
  border-bottom: 1px solid var(--ink);
}

.transport {
  grid-area: transport;
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.transportKey {
  min-width: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
}

.playKey {
  border-color: var(--yellow);
  background: var(--yellow);
}

.playKey span {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid var(--ink);
}

.stopKey span {
  width: 12px;
  height: 12px;
  background: var(--ink);
}

#stateText {
  min-width: 92px;
  margin-left: auto;
  font: 700 0.82rem/1.2 ui-monospace, "Cascadia Mono", monospace;
  text-align: right;
}

.now {
  grid-area: now;
  margin: 0;
  display: grid;
  grid-template-columns: 1.25fr 0.65fr 1fr 0.7fr;
  gap: 1px;
  background: var(--rule);
  border-right: 1px solid var(--rule);
}

.now > div {
  min-width: 0;
  padding: 14px 18px;
  background: var(--white);
}

dt {
  margin: 0 0 4px;
  color: var(--quiet);
  font-size: 0.72rem;
  font-weight: 700;
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.now dd,
.facts dd,
.hitPanel dd {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.82rem;
}

.meter {
  width: min(130px, 70%);
  height: 7px;
  display: inline-block;
  margin-right: 8px;
  background: var(--rule);
  vertical-align: 0.08em;
}

.meter i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--green);
}

.scope {
  grid-area: scope;
  position: relative;
  min-height: 420px;
  height: min(58vh, 720px);
  overflow: hidden;
  background: var(--paper);
}

#scope {
  width: 100%;
  height: 100%;
  display: block;
}

#needle {
  display: none;
}

.hitPanel {
  grid-area: hit;
  min-width: 0;
  display: grid;
  grid-template-columns: 9px minmax(130px, 1fr) minmax(210px, 1.4fr);
  align-items: stretch;
  background: var(--white);
}

.hitPanel > i {
  background: var(--rule);
}

.hitPanel.hot > i {
  background: var(--red);
}

.hitPanel > p {
  min-width: 0;
  margin: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 12px 16px;
  border-right: 1px solid var(--rule);
}

.hitPanel > p b,
.hitPanel > p span {
  overflow-wrap: anywhere;
}

.hitPanel > p span {
  color: var(--quiet);
  font-size: 0.75rem;
}

.hitPanel dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  align-items: center;
}

.hitPanel dl > div {
  min-width: 0;
  padding: 12px;
}

.lanes {
  padding: 0 28px;
  border-bottom: 1px solid var(--ink);
}

#laneList {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lane {
  --tone: var(--blue);
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(170px, 0.9fr) minmax(140px, 0.7fr) minmax(260px, 2.7fr) minmax(140px, 0.8fr);
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--rule);
}

.lane:first-child {
  border-top: 0;
}

.lane.flash {
  box-shadow: inset 6px 0 0 var(--tone);
}

.lane.base b::after {
  content: "TEMPO";
  margin-left: 8px;
  color: var(--red);
  font: 800 0.64rem/1 ui-monospace, "Cascadia Mono", monospace;
}

.lane b,
.lane small,
.lane em,
.lane code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lane b {
  font-size: 0.86rem;
}

.lane small,
.lane em,
.lane code {
  color: var(--quiet);
  font-size: 0.72rem;
}

.lane em {
  font-style: normal;
}

.lane code {
  color: var(--ink);
}

.ticks {
  position: relative;
  height: 30px;
  display: block;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  background: var(--paper);
}

.ticks i {
  position: absolute;
  top: 50%;
  left: var(--position);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tone);
  transform: translate(-50%, -50%);
}

.facts {
  padding: 18px 28px;
  border-bottom: 1px solid var(--ink);
}

.facts dl {
  margin: 0;
  display: grid;
  grid-template-columns: 0.7fr 0.5fr 1fr 1.4fr 1fr;
  gap: 22px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--ink);
}

details {
  min-width: 0;
  border-bottom: 1px solid var(--ink);
}

details:nth-child(odd) {
  border-right: 1px solid var(--ink);
}

summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  margin-left: auto;
  color: var(--blue);
  font-size: 1.4rem;
  font-weight: 500;
}

details[open] summary::after {
  content: "-";
}

.fieldGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  padding: 0 28px 24px;
}

label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--quiet);
  font-size: 0.78rem;
}

input,
select {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.92rem;
}

input::placeholder {
  color: #7c8278;
}

.cycleFields {
  grid-template-columns: repeat(3, 1fr);
}

.outputFields {
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

@media (max-width: 980px) {
  .masthead {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .air {
    grid-template-columns: 1fr;
    grid-template-areas: "transport" "now" "hit" "scope";
  }

  .now {
    border-right: 0;
  }

  .hitPanel {
    border-top: 1px solid var(--rule);
  }

  .lane {
    grid-template-columns: minmax(150px, 0.9fr) minmax(120px, 0.7fr) minmax(230px, 2fr);
  }

  .lane code {
    display: none;
  }

  .facts dl {
    grid-template-columns: repeat(3, 1fr);
  }

  .controls {
    grid-template-columns: 1fr;
  }

  details:nth-child(odd) {
    border-right: 0;
  }
}

@media (max-width: 680px) {
  .masthead {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px;
  }

  .money {
    flex-wrap: wrap;
  }

  .transport {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  #stateText {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }

  .now {
    grid-template-columns: 1fr 1fr;
  }

  .scope {
    min-height: 360px;
    height: 54vh;
  }

  .hitPanel {
    grid-template-columns: 7px 1fr;
  }

  .hitPanel dl {
    grid-column: 2;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--rule);
  }

  .lanes,
  .facts {
    padding-inline: 16px;
  }

  .lane {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 10px 0;
  }

  .lane em,
  .ticks {
    grid-column: 1 / -1;
  }

  .facts dl {
    grid-template-columns: 1fr 1fr;
  }

  summary {
    padding-inline: 16px;
  }

  .fieldGrid,
  .cycleFields,
  .outputFields {
    grid-template-columns: 1fr;
    padding-inline: 16px;
  }
}

@media (max-width: 410px) {
  .transportKey {
    min-width: calc(50% - 4px);
  }

  .now,
  .facts dl {
    grid-template-columns: 1fr;
  }

  .hitPanel dl {
    grid-template-columns: 1fr 1fr;
  }
}
