/* Eightbar app. Same look as the site (eightbar/site/DESIGN.md): one dark surface, Instrument Sans, pink for active only. */
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(vendor/instrument-sans.woff2) format("woff2"); }
:root {
  --bg: #111111; --card: #171717; --line: #2a2a2a; --text: #fafafa; --dim: #a1a1a1; --live: #e0579a; --bad: #ff8a8a;
  --font: "Instrument Sans", system-ui, sans-serif; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gut: clamp(16px, 3vw, 40px); --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font); font-variant-numeric: tabular-nums; }
a { color: inherit; }
a, button, input, textarea, label { touch-action: manipulation; -webkit-tap-highlight-color: rgba(224, 87, 154, .25); }
:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -.02em; margin: 0; font-weight: 700; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gut); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 10; }
.top nav a { text-decoration: none; color: var(--dim); font-size: 15px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.top nav a:hover { color: var(--text); }
.top .mark { flex: none; }
.top nav { display: flex; gap: 22px; align-items: center; min-width: 0; }
.top nav a { max-width: 34vw; flex: none; }
.top nav #who { flex: 0 1 auto; min-width: 0; }
.top .narrow { display: none; }
@media (max-width: 560px) {                       /* phones: the name gives way to a short label so the header never overflows */
  .top { gap: 12px; }
  .top nav { gap: 14px; }
  .top nav a { font-size: 14px; max-width: none; }
  .top .wide { display: none; } .top .narrow { display: inline; }
}
@media (max-width: 370px) { .top .mark { font-size: 0; gap: 0; } }      /* the smallest phones keep the logo, drop the word */
.mark { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 22px; line-height: 1; text-decoration: none; letter-spacing: -.02em; }
.mark.big { font-size: 28px; }
.logo { width: 40px; height: 23px; flex: none; fill: currentColor; }
.logo .dim { opacity: .4; }
.logo .cue { fill: var(--live); }
.logo rect { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .mark.big .logo rect:not(.cue) { animation: wave .5s var(--ease) backwards; }
  .mark.big .logo rect:nth-child(1) { animation-delay: .10s; } .mark.big .logo rect:nth-child(2) { animation-delay: .15s; }
  .mark.big .logo rect:nth-child(3) { animation-delay: .20s; } .mark.big .logo rect:nth-child(4) { animation-delay: .25s; }
  .mark.big .logo rect:nth-child(5) { animation-delay: .30s; } .mark.big .logo rect:nth-child(6) { animation-delay: .35s; }
  .mark.big .logo rect:nth-child(7) { animation-delay: .40s; } .mark.big .logo rect:nth-child(8) { animation-delay: .45s; }
  .mark.big .logo rect:nth-child(9) { animation-delay: .50s; }
  .mark.big .logo .cue { animation: cue .5s .6s var(--ease) both; }
  .busy .logo rect:not(.cue) { animation: pulse 1s var(--ease) infinite alternate; }
}
@keyframes wave { from { transform: scaleY(.1); } }
@keyframes cue { from { opacity: 0; transform: translateY(-4px); } }
@keyframes pulse { to { transform: scaleY(.45); } }

main, main:focus-visible { outline: none; }
.page { width: min(100%, 860px); margin: 0 auto; padding: clamp(24px, 5vw, 48px) var(--gut) 64px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.card { background: var(--card); border: 1px solid var(--line); padding: clamp(18px, 3vw, 28px); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 18px; border: 1px solid var(--text); background: var(--text); color: var(--bg); font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer; transition: background .2s, color .2s, opacity .2s; }
.btn:hover { background: #e6e6e6; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--text); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .g { width: 20px; height: 20px; }

label { display: block; font-size: 14px; color: var(--dim); margin-bottom: 6px; }
input[type=email], input[type=text], textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--bg); color: var(--text); border: 1px solid var(--line); font: 16px/1.4 var(--font); border-radius: 0; }
input:focus, textarea:focus { outline: none; border-color: var(--text); }
form .btn { margin-top: 12px; }

.signin { width: min(100%, 420px); margin: 0 auto; padding: clamp(40px, 12vh, 120px) var(--gut) 48px; text-align: center; }
.signin h1 { margin-top: 36px; }
.signin .sub { color: var(--dim); margin: 8px 0 28px; }
.signin .card { text-align: left; }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 14px; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { margin: 14px 0 0; color: var(--dim); }
.msg:empty { display: none; }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--text); }
.note { color: var(--dim); font-size: 15px; margin-top: 20px; }

.usage { color: var(--dim); margin: 0 0 20px; }
.list { padding: 0; }
.list .empty { padding: 24px; margin: 0; color: var(--dim); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 16px clamp(18px, 3vw, 28px); border-top: 1px solid var(--line); text-decoration: none; }
.row:first-child { border-top: 0; }
.row:hover { background: #1c1c1c; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .d { color: var(--dim); font-size: 14px; }
.row .s { grid-row: span 2; align-self: center; font-size: 14px; color: var(--dim); }
.row .s.live { color: var(--live); }
.row .s.bad { color: var(--bad); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0 0 20px; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* new set */
h2 { font-size: 18px; margin: 0 0 8px; letter-spacing: -.01em; }
.tips { border-left: 2px solid var(--line); padding: 4px 0 4px 18px; margin: 0 0 24px; }
.tips ul { margin: 0; padding-left: 18px; color: var(--dim); }
.tips li + li { margin-top: 4px; }
.eg { color: var(--text); white-space: nowrap; }
.form { display: flex; flex-direction: column; gap: 20px; }
.form .btn { align-self: flex-start; margin-top: 0; }
.label { display: block; font-size: 14px; color: var(--dim); margin-bottom: 6px; }
.drop { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 16px; border: 1px dashed #3a3a3a; background: var(--bg); cursor: pointer; margin: 0; color: var(--text); font-size: 16px; transition: border-color .2s; }
.drop:hover, .drop.over { border-color: var(--text); }
.drop:focus-within { outline: 2px solid var(--live); outline-offset: 2px; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop .pick { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); font-weight: 600; }
.drop .hint { color: var(--dim); font-size: 14px; overflow-wrap: anywhere; }
.drop.has .hint { color: var(--text); }
textarea { resize: vertical; font-family: var(--font); }
.count { margin: 6px 0 0; font-size: 14px; color: var(--dim); }
.count.bad { color: var(--bad); }
.progress .bar { height: 6px; background: var(--line); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--live); transition: width .3s linear; }
.ptext { margin: 8px 0 0; color: var(--dim); font-size: 14px; }

/* one set */
.back { margin: 0 0 12px; font-size: 15px; }
.back a { color: var(--dim); text-decoration: none; }
.back a::before { content: "\2190  "; }
.back a:hover { color: var(--text); }
.state { display: flex; gap: 20px; align-items: flex-start; }
.state p { color: var(--dim); margin: 0 0 12px; }
.state .btn { margin-top: 4px; }
.state.bad h2 { color: var(--bad); }
.logo.working { width: 52px; height: 30px; margin-top: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .logo.working rect:not(.cue) { animation: pulse .9s var(--ease) infinite alternate; }
  .logo.working rect:nth-child(2n) { animation-delay: .2s; }
  .logo.working rect:nth-child(3n) { animation-delay: .4s; }
}
.exports { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.chapters { list-style: none; margin: 16px 0 0; padding: 0; }
.chapters li { display: grid; grid-template-columns: 5.5em 1fr; gap: 12px; padding: 10px clamp(18px, 3vw, 28px); border-top: 1px solid var(--line); }
.chapters li:first-child { border-top: 0; }
.chapters time { font-family: var(--mono); color: var(--dim); font-size: 14px; padding-top: 2px; }
.problems { border: 1px solid var(--bad); padding: 14px 18px; margin-bottom: 16px; }
.problems ul { margin: 0; padding-left: 18px; color: var(--text); }
.state p:last-child { margin-bottom: 0; }
select { width: 100%; min-height: 44px; padding: 0 40px 0 12px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23a1a1a1' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 10px center / 22px; color: var(--text); border: 1px solid var(--line); font: 16px/1.4 var(--font); border-radius: 0; -webkit-appearance: none; appearance: none; }
select:focus { outline: none; border-color: var(--text); }
.opt { color: #6e6e6e; font-size: 13px; margin-left: 4px; }

/* chapter editor (ported from the Kineq editor) */
.page.wide { width: min(100%, 1240px); }
.savebar { display: flex; align-items: center; gap: 14px; }
.estatus { color: var(--dim); font-size: 14px; text-align: right; }
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; }
.transport .btn { min-height: 44px; padding: 0 14px; }
.transport svg { width: 18px; height: 18px; fill: currentColor; }
.transport [data-back8] svg, .transport [data-fwd8] svg { fill: none; stroke: currentColor; stroke-width: 2; }
.clock { font-family: var(--mono); font-size: 14px; color: var(--dim); margin: 0 6px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; color: var(--text); margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--live); flex: none; }
.keys { color: var(--dim); font-size: 14px; margin: 10px 0 16px; }
@media (hover: none) { .keys .desk { display: none; } }
.wave { padding: 12px 14px 14px; margin-bottom: 12px; }
.wlabel { display: flex; justify-content: space-between; gap: 12px; color: var(--dim); font-size: 13px; margin-bottom: 8px; }
.wave canvas { display: block; width: 100%; background: var(--bg); cursor: pointer; touch-action: none; }
[data-overview] { height: 96px; }
[data-zoom] { height: 140px; }
.egrid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .egrid { grid-template-columns: 1fr; } }
.tracks { padding: 12px 0 0; }
.tracks .wlabel { padding: 0 14px; }
.tracks ol { list-style: none; margin: 0; padding: 0; }
.trow { display: grid; grid-template-columns: 2.2em 6.6em minmax(0, 1fr) 4.6em 44px; gap: 6px; align-items: center; padding: 4px 8px 4px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.trow.sel { background: #22161c; box-shadow: inset 2px 0 var(--live); }
.trow .n { font-family: var(--mono); color: var(--dim); font-size: 13px; }
.trow .n.bad { color: var(--bad); }
.trow input { min-height: 40px; background: transparent; border: 1px solid transparent; padding: 0 8px; color: var(--text); font: 15px/1.3 var(--font); width: 100%; border-radius: 0; }
.trow input.time { font-family: var(--mono); font-size: 14px; background: var(--bg); border-color: var(--line); }
.trow input:hover { border-color: var(--line); }
.trow input:focus { border-color: var(--text); outline: none; background: var(--bg); }
.trow .d { font-family: var(--mono); font-size: 12px; color: var(--dim); white-space: nowrap; text-align: right; }
.trow .d.moved { color: var(--live); }
.icon { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 1px solid transparent; color: var(--dim); cursor: pointer; }
.icon:hover { color: var(--text); border-color: var(--line); }
.icon svg { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 560px) {
  .trow { grid-template-columns: 2em minmax(0, 1fr) auto 44px; grid-template-areas: "n t d p" "n x x x"; padding: 8px 6px 8px 12px; }
  .trow .n { grid-area: n; align-self: start; padding-top: 12px; }
  .trow .time { grid-area: t; max-width: 9em; }
  .trow .title { grid-area: x; }
  .trow .d { grid-area: d; }
  .trow .icon { grid-area: p; }
}
.yt { display: flex; flex-direction: column; gap: 10px; }
.yt pre { margin: 0; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); padding: 12px; max-height: 420px; overflow: auto; }
.plist { list-style: none; margin: 0; padding: 0; font-size: 14px; display: grid; gap: 4px; }
.plist li { color: var(--bad); }
.plist li.ok { color: var(--text); }
.yt .btn { align-self: flex-start; }
.editor .head { flex-wrap: wrap; }
.asec { margin-top: 16px; }
.asec p { color: var(--dim); margin: 0 0 12px; max-width: 60ch; }
.asec .msg { margin-top: 8px; }
.btn.danger { color: var(--bad); border-color: #4a2a2a; }
.btn.danger:hover { border-color: var(--bad); }
#genre_other { margin-top: 8px; }
.tlhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.shotbtn { position: relative; color: var(--text); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; margin: 0 0 6px; }
.shotbtn:hover { color: var(--live); }
.shotbtn:focus-within { outline: 2px solid var(--live); outline-offset: 2px; }
.shotbtn { overflow: hidden; }
.shotbtn input, .drop input { position: absolute; left: 0; top: 0; opacity: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }   /* Safari gives file inputs a wide minimum size */
.tlwrap { position: relative; }
.tlwrap textarea { display: block; }
.tldrop { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; background: rgba(17, 17, 17, .88); border: 2px dashed var(--live); color: var(--text); font-weight: 600; font-size: 17px; opacity: 0; transform: scale(.985); pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease); }
.tlwrap.over .tldrop, .tlwrap.reading .tldrop { opacity: 1; transform: none; }
.tlwrap.reading .tldrop span::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .tldrop { transition: none; } }

.fb { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.fb h2 { margin: 0; }
.fbbtns { display: flex; gap: 10px; flex-wrap: wrap; }
.fbbtns [aria-pressed="true"] { border-color: var(--live); color: var(--text); box-shadow: inset 0 -2px var(--live); }
.fb [data-fbmore] { display: flex; flex-direction: column; gap: 10px; }
.fb [data-fbmore] .btn { align-self: flex-start; }
.fb[data-tell] .btn { align-self: flex-start; }
.fb[data-tell] label { color: var(--text); line-height: 1.5; }
