* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 50% -100px, #16233a 0%, #0c1420 55%, #090f18 100%);
  color: #e9e4d8; min-height: 100vh; padding: 18px 22px;
}
#topbar { display: flex; justify-content: space-between; align-items: center; margin: 0 auto 16px; max-width: 1284px; }
#brand { display: flex; align-items: baseline; gap: 12px; }
#logo { font-family: Georgia, 'Times New Roman', serif; font-size: 30px; color: #e8b84b; letter-spacing: 1px; }
#tagline { color: #7d8aa0; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
#controls { display: flex; gap: 10px; align-items: center; }
.group { display: flex; gap: 8px; align-items: center; background: #141d2c; border: 1px solid #26364e; border-radius: 10px; padding: 6px 8px; }
button {
  background: #e8b84b; color: #201607; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
button:hover { background: #f3c75f; }
button:disabled { background: #3a4353; color: #8a93a3; cursor: not-allowed; }
button.ghost { background: transparent; border: 1px solid #3a4a63; color: #cfd6e0; font-weight: 500; }
button.ghost:hover { border-color: #e8b84b; color: #e8b84b; }
#recordBtn { background: #c0392b; color: #fff; }
#recordBtn:hover { background: #d6493a; }
#recordBtn:disabled { background: #3a4353; color: #8a93a3; }
select {
  background: #0f1725; color: #e9e4d8; border: 1px solid #26364e;
  border-radius: 8px; padding: 7px 8px; font-size: 13px;
}
#statusPill { color: #7d8aa0; font-size: 12px; padding: 0 4px; }
main { max-width: 1284px; margin: 0 auto; }
#performance-title { margin-bottom: 16px; }
#performance-title label { display: block; color: #aab7c8; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px; }
#piece-title { display: block; width: 100%; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; color: #e8b84b; font: 26px Georgia, serif; text-overflow: ellipsis; }
#piece-title::placeholder { color: #8d99ac; }
#piece-title:hover { border-color: #26364e; }
#piece-title:focus { outline: 2px solid #e8b84b; outline-offset: 2px; background: #0d141f; }
#stage {
  background: linear-gradient(180deg, #1d2a3e 0%, #131d2d 100%);
  border: 1px solid #2a3b55; border-radius: 16px; padding: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05);
  margin-bottom: 16px;
}
#pianoCanvas { display: block; width: 100%; border-radius: 8px; }
#dock {
  background: #121b29; border: 1px solid #26364e; border-radius: 14px;
  overflow: hidden;
}
#tabs { display: flex; border-bottom: 1px solid #26364e; background: #0e1622; }
.tab {
  background: transparent; color: #8d99ac; border: none; border-radius: 0;
  padding: 11px 22px; font-size: 13.5px; font-weight: 600; letter-spacing: .3px;
}
.tab:hover { background: #15202f; color: #cfd6e0; }
.tab.active { color: #e8b84b; box-shadow: inset 0 -2px 0 #e8b84b; background: #121b29; }
.tabpane { display: none; padding: 14px; }
.tabpane.active { display: block; }
#sheet { color: #201e1a; background: #f5f1e6; border-radius: 8px; padding: 10px; min-height: 120px; overflow-x: auto; }
#sheet svg { max-width: 100%; }
#sheet .placeholder { color: #97906f; font-size: 13.5px; padding: 40px 0; text-align: center; }
#abcInput {
  width: 100%; height: 150px; background: #0d141f; color: #dfe6ef;
  border: 1px solid #26364e; border-radius: 8px; padding: 10px;
  font-family: Consolas, monospace; font-size: 12.5px; resize: vertical;
}
.row { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.muted { color: #7d8aa0; font-size: 12.5px; }
#pane-help { font-size: 13px; line-height: 1.6; max-width: 760px; }
#pane-help h2 { font-family: Georgia, serif; color: #e8b84b; font-size: 17px; margin-bottom: 8px; font-weight: 500; }
#pane-help p { margin: 7px 0; }
#pane-help code { background: #0d141f; border: 1px solid #26364e; padding: 1px 6px; border-radius: 5px; font-size: 12px; }
#pane-help table { border-collapse: collapse; margin: 8px 0; }
#pane-help td, #pane-help th { border: 1px solid #26364e; padding: 4px 9px; font-size: 12px; }
#pane-help th { color: #8d99ac; text-align: left; }
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #e8b84b; color: #201607; padding: 11px 24px; border-radius: 10px;
  font-size: 14px; font-weight: 600; display: none; z-index: 50;
  box-shadow: 0 8px 26px rgba(0,0,0,.5); max-width: 80vw;
}
.live-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.live-heading h2 { font: 24px Georgia, serif; color: #e8b84b; }
.live-explanation { margin-top: 12px; color: #dfe6ef; line-height: 1.6; }
.live-caption { font-size: 12px; color: #9aa8ba; line-height: 1.6; margin-top: 6px; }
.live-grid { display: grid; grid-template-columns: 3fr 1fr; gap: 16px; margin-top: 18px; }
.input-scheme-control { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0 8px; }
.input-scheme-control select { padding: 8px 12px; background: #151e2c; color: #e8e3d7; border: 1px solid #52617a; border-radius: 6px; font: inherit; }
.input-binding-table { max-height: 380px; overflow-y: auto; }
.live-card { background: #0d141f; border: 1px solid #26364e; border-radius: 10px; padding: 16px; min-width: 0; }
.live-card h3 { color: #aab7c8; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.live-held { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; min-height: 58px; }
.live-key { display: inline-flex; gap: 12px; align-items: center; }
.live-held .live-key { background: #172d27; border: 1px solid #3f8f72; padding: 12px; border-radius: 8px; }
.live-key kbd { font: 14px Consolas, monospace; color: #e8b84b; border: 1px solid #586274; border-bottom-width: 3px; border-radius: 5px; padding: 4px 8px; white-space: nowrap; }
.live-key strong { font-size: 18px; color: #7df0c0; }
.live-empty { color: #9aa8ba; font-size: 14px; padding: 10px 0; }
.live-recent { list-style: none; height: 190px; overflow: hidden; }
.live-recent li { height: 38px; display: flex; gap: 14px; align-items: center; animation: live-fade 8s linear forwards; }
.live-action { width: 62px; font: 11px Consolas, monospace; color: #aab7c8; }
.live-action.down { color: #7df0c0; }
@keyframes live-fade { 0%, 40% { opacity: 1; } 100% { opacity: .25; } }
@media (max-width: 650px) { .live-grid { grid-template-columns: 1fr; } .tab { padding: 11px 12px; } }

.live-sub { color: #7d8aa0; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin: 14px 0 8px; }
.live-time { margin-left: auto; color: #7d8aa0; font: 11px Consolas, monospace; }

.vl-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vl-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.vl-btn { background: #1c2836; color: #cfd6e0; border: 1px solid #3a4a63; border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 500; }
.vl-btn:hover { border-color: #e8b84b; color: #e8b84b; }
.vl-btn.active { background: #e8b84b; color: #201607; border-color: #e8b84b; font-weight: 700; }
.vl-btn.loading { opacity: .55; }
@media (max-width: 900px) { .vl-groups { grid-template-columns: 1fr; } }

.sheet-dialog-error { color:#ffae9d; }

#sheet-name { box-sizing:border-box; margin:0; padding:4px 8px; border:2px solid #c3974f; border-radius:4px; background:#10151c; color:#e8e3d7; font:24px sans-serif; z-index:20; }
