.co-page .nv-app {
  grid-template-columns: 280px minmax(0, 1fr);
}

.co-side-scroll {
  overflow: auto;
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}

.co-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.co-field label,
.co-tools-label {
  font-size: 0.75rem;
  font-weight: 650;
  color: #6b625b;
  margin: 0;
}

.co-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.co-tools {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.co-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

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

.co-tool {
  appearance: none;
  border: 1px solid transparent;
  background: #f7f4f1;
  border-radius: 8px;
  min-height: 2.6rem;
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  touch-action: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
}

.co-note {
  width: 1.35rem;
  height: 1.8rem;
  display: block;
  overflow: visible;
}

.co-tool i {
  font-size: 1.05rem;
}

.co-tool:hover {
  border-color: var(--accent, #ff5733);
  background: #fff;
}

.co-tool.is-on {
  background: #fff5f2;
  color: var(--accent, #ff5733);
  box-shadow: 0 0 0 1px var(--accent, #ff5733);
}

.co-ghost-wrap {
  position: absolute;
  transform: translate(-50%, -62%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 6;
  color: var(--accent, #ff5733);
}

.co-ghost-note {
  position: relative;
  width: 28px;
  height: 36px;
}

.co-ghost-svg {
  width: 24px;
  height: 32px;
  position: absolute;
  left: 2px;
  top: 2px;
  overflow: visible;
}

.co-ledger {
  position: absolute;
  left: 4px;
  width: 20px;
  height: 2px;
  background: currentColor;
  top: 24px;
  transform: translateY(-50%);
}

.co-ghost-wrap .co-ghost {
  position: relative;
  left: auto;
  top: auto;
}

.co-ghost-name {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--accent, #ff5733);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 87, 51, 0.35);
  border-radius: 4px;
  padding: 0 0.32rem;
  line-height: 1.35;
  box-shadow: 0 1px 4px rgba(40, 24, 16, 0.12);
}

.co-ghost,
.co-sel {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.co-ghost {
  width: 16px;
  height: 12px;
  background: rgba(255, 87, 51, 0.92);
  box-shadow: 0 0 0 2px rgba(255, 87, 51, 0.28);
  transform: translate(-50%, -50%) rotate(-20deg);
}

.co-ghost.is-rest {
  width: 10px;
  height: 18px;
  border-radius: 2px;
  background: rgba(42, 42, 42, 0.45);
  box-shadow: none;
  transform: translate(-50%, -50%);
}

.co-dot-mark {
  font-size: 1.05rem;
  font-weight: 700;
}

.co-sel {
  width: 18px;
  height: 14px;
  background: transparent;
  box-shadow: 0 0 0 2px var(--accent, #ff5733);
  border-radius: 8px;
}

.co-start {
  position: fixed;
  inset: var(--nav-h, 4.6rem) 0 0 0;
  background: rgba(28, 22, 18, 0.42);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.co-start[hidden] {
  display: none !important;
}

.co-start-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.4rem 1.3rem 1.2rem;
  max-width: 34rem;
  width: 100%;
  box-shadow: 0 18px 50px rgba(40, 24, 16, 0.22);
}

.co-start-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.co-start-card p {
  margin: 0 0 1rem;
  color: #6b625b;
}

.co-start-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.co-start-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: 6.2rem;
  padding: 0.85rem 0.9rem;
  text-align: left;
  white-space: normal;
}

.co-start-choice strong {
  font-size: 1.05rem;
}

.co-start-choice span {
  font-size: 0.82rem;
  color: #6b625b;
  font-weight: 400;
}

.co-start-choice.nv-btn-primary span {
  color: rgba(255, 255, 255, 0.88);
}

#coStartResume {
  margin-top: 0.8rem;
  width: 100%;
}

.co-page #osmdCanvas {
  cursor: crosshair;
  touch-action: pan-x pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.co-mobile-only {
  display: none;
}

.co-dock {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.co-aim {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid var(--accent, #ff5733);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 1px #fff;
  z-index: 3;
}

.co-aim::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 2px;
  height: 52px;
  margin-left: -1px;
  background: rgba(255, 87, 51, 0.72);
}

.co-page.is-select #osmdCanvas {
  cursor: pointer;
}

.co-page.is-dragging #osmdCanvas {
  cursor: grabbing;
}

@media (max-width: 900px) {
  .co-page {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .co-page .nv-app {
    grid-template-columns: 1fr;
    padding-left: max(0.6rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.6rem, env(safe-area-inset-right, 0px));
    touch-action: manipulation;
  }

  .co-page .nv-toolbar {
    padding-bottom: 0.45rem;
  }

  .co-page .nv-now {
    display: none;
  }

  .co-page .nv-toolbar-transport {
    flex-wrap: nowrap;
    gap: 0.3rem;
  }

  .co-page .nv-toolbar-transport > .nv-btn,
  .co-page .co-dock .nv-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .co-page .co-pitch-btn {
    min-width: 48px;
    min-height: 48px;
    font-size: 1.2rem;
  }

  .co-page .co-pitch-btn i {
    font-size: 1.35rem;
  }

  .co-page #playScore span,
  .co-page #stopScore span,
  .co-page #coDelete span,
  .co-page #coOpenPalette span {
    display: none;
  }

  @media (max-width: 560px) {
    .co-page .nv-progress {
      display: none;
    }
  }

  .co-page #coDelete {
    padding: 0 0.55rem;
  }

  .co-mobile-only {
    display: inline-flex;
  }

  .co-page .nv-toolbar-tools {
    display: none;
  }

  .co-page.co-more-open .nv-toolbar-tools {
    display: flex;
  }

  .co-page .nv-score-wrap {
    padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
  }

  .co-page .nv-sidebar {
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: min(72dvh, 34rem);
    border-radius: 16px 16px 0 0;
    transform: translateY(110%);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -16px 40px rgba(40, 24, 16, 0.16);
  }

  .co-page .nv-sidebar::before {
    content: "";
    display: block;
    width: 2.4rem;
    height: 4px;
    margin: 0.5rem auto 0.15rem;
    background: #d8cfc7;
    border-radius: 99px;
  }

  .co-page.library-open .nv-sidebar {
    transform: none;
  }

  .co-page .co-tool {
    min-height: 44px;
    min-width: 44px;
    font-size: 1.32rem;
  }

  .co-start-actions {
    grid-template-columns: 1fr;
  }
}
