.pagehead { padding: 48px 0 0; }
.saved { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

.hint { color: var(--muted); font-size: 0.88rem; margin: 10px 0 0; }
.hint.top { margin: -4px 0 14px; }

/* 1 · song and lyrics */
.setup { display: grid; gap: 16px; }
.setup .label { margin-bottom: -4px; }

.drop {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1.5px dashed rgba(51, 37, 78, 0.22);
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.95rem;
  transition: border-color .15s ease, background .15s ease;
}
.drop b { font-family: var(--disp); color: var(--white); background: var(--brand); border-radius: 100px; padding: 7px 18px; white-space: nowrap; font-size: 0.9rem; }
.drop.over, .drop:hover { border-color: var(--brand); background: var(--warm); }
.drop.loaded { border-style: solid; border-color: var(--warm-line); background: var(--warm); }
.drop.loaded span { color: var(--brand-deep); font-weight: 600; }

details summary { cursor: pointer; font-family: var(--disp); font-weight: 700; color: var(--plum); font-size: 1.05rem; margin-bottom: 10px; }
details summary .mono { font-family: var(--body); font-weight: 500; font-size: 0.88rem; margin-left: 6px; }

textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font: 17px/1.7 var(--cjk);
}
textarea:focus, input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* 2 · stage (dark plum panel) */
.stage .label { margin-bottom: 4px; }
.nowwrap { min-height: 168px; padding: 4px 2px 16px; }
.section { color: var(--peach); font: 700 0.76rem var(--disp); letter-spacing: 0.12em; min-height: 20px; }
.now { font-family: var(--cjk); font-size: clamp(30px, 5.4vw, 52px); font-weight: 700; line-height: 1.35; min-height: 70px; margin-top: 4px; }
.next { font-family: var(--cjk); font-size: 19px; color: rgba(255, 255, 255, 0.38); margin-top: 6px; min-height: 28px; }

.now .u { color: rgba(255, 255, 255, 0.30); border-radius: 6px; padding: 0 1px; transition: color 60ms; }
.now .u.done { color: rgba(255, 255, 255, 0.72); }
.now .u.on { color: var(--peach); }
.now .u.cur { color: #fff; box-shadow: inset 0 -4px 0 var(--brand); }
.now .p { color: rgba(255, 255, 255, 0.30); }
.now .w { margin: 0 0.18em; }

#tl {
  display: block;
  width: 100%;
  height: 140px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  cursor: crosshair;
  touch-action: none;
}

.transport, .progress, .exportbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.exportbar .label { width: 100%; margin-bottom: 2px; }
.time { font-size: 15px; min-width: 92px; color: #fff; }
.grow { flex: 1; }

.stage button {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.86);
}
.stage button:hover { border-color: var(--peach); color: #fff; }
.stage button.on { background: rgba(205, 90, 31, 0.30); border-color: transparent; color: #FFD9BF; }
.stage button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.stage button.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }

.seg { display: inline-flex; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 100px; padding: 3px; gap: 2px; }
.stage .seg button { border: 0; background: transparent; padding: 5px 12px; }
.stage .seg button.on { background: var(--brand); color: #fff; }

.lat { font-size: 0.85rem; color: rgba(255, 255, 255, 0.6); }
.lat input {
  width: 74px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 100px;
  padding: 5px 10px;
  font: 13px var(--mono);
}

.stage .pad {
  display: block;
  white-space: normal;
  width: 100%;
  margin-top: 16px;
  padding: 28px 14px;
  font-family: var(--body);
  font-weight: 500;
  font-size: 1rem;
  border: 1.5px dashed rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.stage .pad.down { background: rgba(205, 90, 31, 0.28); border-color: var(--brand); border-style: solid; color: #fff; }
#prog { color: rgba(255, 255, 255, 0.75); font-size: 14px; }

/* 3 · sheet */
.sheet { display: grid; gap: 10px; }
.line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px; }
.line .lab { width: 100%; font: 700 0.72rem var(--disp); color: var(--brand-deep); letter-spacing: 0.12em; margin-top: 10px; }
.chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
  padding: 4px 6px 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
  font-family: var(--cjk);
  font-size: 19px;
  line-height: 1.2;
  color: var(--ink);
  transition: border-color .1s ease;
}
.chip:hover { border-color: var(--brand); }
.chip i { font-style: normal; font: 9.5px var(--mono); color: var(--muted); margin-top: 2px; min-height: 11px; }
.chip.done { background: var(--warm); border-color: var(--warm-line); }
.chip.done i { color: var(--brand-deep); }
.chip.cur { border-color: var(--brand); box-shadow: 0 0 0 1.5px var(--brand); }
.chip.sel { background: var(--plum); border-color: var(--plum); color: #fff; }
.chip.sel i { color: var(--peach); }
.chip.on { color: var(--brand); }
.chip.sel.on { color: var(--peach); }
.chip .pp { color: var(--muted); }
.chip.sel .pp { color: rgba(255, 255, 255, 0.5); }

/* 4 · export */
button.danger:hover { border-color: #B3261E; color: #B3261E; }

/* keys */
.keys dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 0.95rem; }
.keys dt {
  font: 600 12px var(--mono);
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-radius: 100px;
  padding: 3px 10px;
  justify-self: start;
  align-self: start;
}
.keys dd { margin: 0; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--plum-deep);
  color: #fff;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(30, 21, 55, 0.3);
  z-index: 50;
}

@media (max-width: 640px) {
  .pagehead { padding-top: 32px; }
  .drop { flex-direction: column; align-items: flex-start; gap: 10px; }
  .transport .lat { width: 100%; }
  .keys dl { grid-template-columns: 1fr; gap: 4px; }
  .keys dd { margin-bottom: 8px; }
}
