/* Deliberately undecorated: system fonts, plain rules, no visual taste applied.
   Per the project rule, the visual pass happens later and by someone qualified. */

:root {
  --fg: #111;
  --bg: #fff;
  --muted: #666;
  --line: #ccc;
  --panel: #f4f4f4;
  --accent: #063;
  --alert: #a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e8e8;
    --bg: #141414;
    --muted: #999;
    --line: #3a3a3a;
    --panel: #1e1e1e;
    --accent: #6c6;
    --alert: #f66;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
  max-width: 60rem;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
h3 { font-size: .95rem; margin: 1rem 0 .35rem; }

header { margin-bottom: 1.5rem; }
.sub { color: var(--muted); margin: 0; }

section {
  border: 1px solid var(--line);
  padding: .85rem;
  margin-bottom: 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin: .5rem 0;
}

button {
  font: inherit;
  padding: .45rem .8rem;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  /* Touch targets: this is used on an iPad at a piano, sometimes with the wrong hand. */
  min-height: 44px;
}
button.big { min-width: 10rem; font-weight: 600; }
button:disabled { opacity: .45; cursor: default; }

select, label { font: inherit; }
select { min-height: 44px; padding: .3rem; background: var(--panel); color: var(--fg);
         border: 1px solid var(--line); }

.note { color: var(--muted); font-size: .82rem; margin: .3rem 0; }

.status {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85rem;
  padding: .4rem .5rem;
  background: var(--panel);
  border-left: 3px solid var(--line);
  white-space: pre-wrap;
}
.status.err { border-left-color: var(--alert); color: var(--alert); }
.status.ok { border-left-color: var(--accent); }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  /* Wide rows must scroll inside the table, never push the page sideways. */
  display: block;
  overflow-x: auto;
}
table.data th, table.data td {
  border: 1px solid var(--line);
  padding: .25rem .4rem;
  text-align: left;
  white-space: nowrap;
}
table.data th { background: var(--panel); font-weight: 600; }
table.data td.k { color: var(--muted); width: 16rem; white-space: normal; }
table.data td.v { white-space: pre-wrap; word-break: break-word; }
table.data tr.bad td.v { color: var(--alert); }
table.data tr.good td.v { color: var(--accent); }

.log {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: .5rem;
  max-height: 12rem;
  overflow: auto;
  margin: 0;
}

canvas#spectrum {
  width: 100%;
  height: 240px;
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  touch-action: none;
}

.pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  padding: .3rem .5rem;
  border: 1px solid var(--line);
  background: var(--panel);
}
#onset-flash { transition: none; }
#onset-flash.hit { background: var(--accent); color: var(--bg); border-color: var(--accent); }

#tbl-events tbody tr:nth-child(odd) { background: var(--panel); }

a.dl {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
