:root {
  color-scheme: light;
  --bg: #161616;
  --panel: #22201e;
  --panel-2: #2d2a26;
  --paper: #fbfaf6;
  --paper-2: #eee9dd;
  --text: #f5f3ed;
  --muted: #b9b2a7;
  --ink: #1e1c19;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #d0cf2c;
  --danger: #ff6666;
  --ok: #64c987;
  --g: #f7a03a;
  --d: #68bf66;
  --a: #2f80ed;
  --e: #ef4f4f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #302d29;
  color: var(--text);
  cursor: pointer;
  min-height: 36px;
  padding: 0 12px;
}

button:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: #3a3631;
}

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

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1b1a14;
  font-weight: 700;
}

button.ghost {
  background: transparent;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #1f1e1b;
  color: var(--text);
  min-height: 36px;
  padding: 0 10px;
}

textarea {
  min-height: 88px;
  padding: 10px;
  resize: vertical;
}

a {
  color: var(--accent);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  min-height: 58px;
  padding: 0 18px;
}

.brand {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-size: 19px;
  font-weight: 800;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 7px;
  color: #191810;
  display: inline-flex;
  font-weight: 900;
  height: 31px;
  justify-content: center;
  width: 31px;
}

.topnav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.topnav a {
  border-radius: 7px;
  color: var(--muted);
  padding: 8px 10px;
  text-decoration: none;
}

.topnav a.active,
.topnav a:hover {
  background: #2b2925;
  color: var(--text);
}

.view {
  margin: 0 auto;
  max-width: 1320px;
  padding: 22px;
  width: 100%;
}

.view.narrow {
  max-width: 940px;
}

.view-head {
  align-items: flex-end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.view-head h1,
.view-head h2 {
  margin: 0 0 5px;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.library-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
}

.project-card {
  display: grid;
  gap: 12px;
}

.project-icon {
  align-items: center;
  background: #151515;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  height: 90px;
  justify-content: center;
  position: relative;
}

.strings-icon {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(4, 8px);
  height: 64px;
}

.strings-icon span {
  border-radius: 99px;
  display: block;
  width: 8px;
}

.badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
}

.badge.review {
  background: rgba(208, 207, 44, 0.16);
  color: #eceb74;
}

.badge.ok {
  background: rgba(100, 201, 135, 0.14);
  color: #8be0a8;
}

.badge.blocking {
  background: rgba(255, 102, 102, 0.16);
  color: #ff9b9b;
}

.card-title {
  font-size: 18px;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drop-zone {
  align-items: center;
  background: #1d1b18;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  justify-items: center;
  min-height: 220px;
  padding: 30px;
  text-align: center;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: rgba(208, 207, 44, 0.08);
}

.import-progress {
  display: grid;
  gap: 8px;
}

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

.status-dot {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.status-dot.done {
  background: var(--ok);
}

.status-dot.pending {
  background: #777268;
}

.workspace-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.timeline {
  display: grid;
  gap: 8px;
  max-height: 60vh;
  overflow: auto;
}

.note-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 8px;
  grid-template-columns: 72px 1fr auto;
  padding: 8px;
}

.note-row.selected {
  border-color: var(--accent);
  background: rgba(208, 207, 44, 0.08);
}

.note-row.review {
  border-color: rgba(208, 207, 44, 0.35);
}

.lane-pill {
  border-radius: 999px;
  color: #111;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  min-width: 34px;
  padding: 3px 8px;
}

.inspector {
  display: grid;
  gap: 14px;
}

.control-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
}

.control-grid.five {
  grid-template-columns: repeat(5, 1fr);
}

.control-grid button.active {
  background: var(--accent);
  color: #161616;
  font-weight: 800;
}

.player {
  display: grid;
  gap: 0;
  grid-template-rows: minmax(340px, 58vh) auto auto;
  min-height: calc(100vh - 59px);
  max-width: none;
  padding: 0;
}

.player-stage {
  background: #0f0f0f;
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.highway-wrap {
  align-self: stretch;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#highway {
  display: block;
  height: 100%;
  max-height: 100%;
  width: 100%;
}

.fingerboard-panel {
  background: #fbfaf6;
  border-left: 18px solid var(--accent);
  color: var(--ink);
  display: grid;
  min-height: 0;
  min-width: 0;
  place-items: center;
}

.fingerboard-panel svg {
  height: min(92%, 520px);
  max-width: 92%;
}

.notation-strip {
  background: var(--paper);
  color: var(--ink);
  min-height: 172px;
  overflow-x: auto;
  overflow-y: auto;
  padding: 12px 18px;
}

.fallback-score svg {
  display: block;
  min-width: 900px;
  width: 100%;
}

.osmd-status {
  color: #615b52;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 0 10px;
}

.osmd-host {
  min-width: 960px;
}

.osmd-host svg {
  display: block;
}

.player-controls {
  align-items: center;
  background: #1f1d1a;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
}

.player-controls label {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.range {
  width: 120px;
}

.number-control {
  width: 76px;
}

.osmd-host [id^="cursorImg"] {
  opacity: 0.28 !important;
  transform: translate(-5px, -5px) !important;
}

.media-panel {
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 14px 18px;
}

.media-panel.collapsed {
  display: none;
}

.split {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.warning-list {
  display: grid;
  gap: 8px;
}

.warning-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}

.warning-item.review {
  border-color: rgba(208, 207, 44, 0.35);
}

.warning-item.blocking {
  border-color: rgba(255, 102, 102, 0.5);
}

.dialog-backdrop {
  align-items: center;
  background: rgba(0, 0, 0, 0.68);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 20;
}

.dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 560px;
  padding: 18px;
  width: 100%;
}

.empty {
  align-items: center;
  color: var(--muted);
  display: grid;
  gap: 12px;
  justify-items: center;
  min-height: 260px;
  text-align: center;
}

@media (max-width: 860px) {
  .view {
    padding: 16px;
  }

  .view.player {
    padding: 0;
  }

  .view-head,
  .workspace-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .view-head {
    align-items: stretch;
    display: grid;
  }

  .player {
    grid-template-rows: minmax(420px, 58vh) auto auto;
  }

  .player-stage {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 180px;
  }

  .fingerboard-panel {
    border-left: 0;
    border-top: 12px solid var(--accent);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .topnav {
    margin-left: 0;
  }
}

@media (max-height: 760px) {
  .notation-strip {
    padding-bottom: 8px;
    padding-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
