/* Arrangement editing controls use the studio theme and remain usable in the mobile tools sheet. */
#daw-timeline-controls { grid-column: 1 / -1; min-width: 0; width: 100%; }
.daw-timeline-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: 100%; min-width: 0; padding-top: 10px; border-top: 1px solid var(--border-color); font-size: 11px; }
.daw-grid-control { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text-muted-color); }
.daw-timeline-tools :is(input, select) { box-sizing: border-box; height: 30px; min-height: 30px; border: 1px solid var(--border-color); border-radius: 5px; background: var(--secondary-surface); color: var(--text-color); font: inherit; font-size: 12px; padding: 4px 6px; margin: 0; }
.daw-timeline-tools #daw-grid-bpm { width: 57px; }
.daw-timeline-tools #daw-grid-snap { width: 78px; }
.daw-timeline-tools :is(input, select, button):focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.daw-timeline-divider { width: 1px; height: 23px; background: var(--border-color); }
.daw-loop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.daw-region-menu .daw-loop-actions { display: grid; gap: 4px; }
.daw-region-menu .daw-menu-panel { min-width: 170px; }
.daw-mobile-sheet .daw-timeline-tools > .daw-menu-panel { display: contents; }
.app-container:not(.daw-mobile) > .controls-container .daw-timeline-tools button { height: 30px; min-height: 30px; padding: 3px 8px; font-size: 11px; }
.daw-grid-hint { margin-left: auto; color: var(--text-muted-color); font-size: 10px; white-space: nowrap; }
.daw-loop-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
#timeline-grid.daw-musical-grid { background-image: linear-gradient(to right, var(--grid-line-major, rgba(255,255,255,.14)) 1px, transparent 1px), linear-gradient(to right, var(--grid-line-minor, rgba(255,255,255,.06)) 1px, transparent 1px), linear-gradient(to right, var(--grid-line-minor, rgba(255,255,255,.06)) .5px, transparent .5px); background-size: var(--daw-grid-bar) 100%, var(--daw-grid-beat) 100%, var(--daw-grid-minor) 100%; background-position: 0 0; background-repeat: repeat-x; }
.daw-musical-ruler { position: absolute; inset: 0; pointer-events: none; }
.daw-ruler-mark { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--border-color); padding: 7px 0 0 5px; font-size: 10px; line-height: 15px; color: var(--text-muted-color); white-space: nowrap; }
.daw-ruler-bar { color: var(--text-color); border-left-color: var(--text-muted-color); font-weight: 600; }
.daw-loop-band { position: absolute; top: 0; bottom: 0; box-sizing: border-box; min-width: 1px; border-top: 3px solid #a99bff; border-bottom: 1px solid #a99bff; background: var(--secondary-surface, #514662); background: color-mix(in srgb, var(--secondary-surface, #363640) 74%, #8970da); z-index: 4; cursor: grab; touch-action: none; user-select: none; }
.daw-loop-band-label { display: block; overflow: hidden; text-overflow: ellipsis; margin: 3px 25px 0; font-size: 10px; line-height: 18px; color: var(--text-color); white-space: nowrap; text-align: center; pointer-events: none; }
#timeline-ruler .daw-loop-handle { position: absolute; top: 0; bottom: 0; height: 100%; width: 20px; min-width: 20px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 2px; background: #8872da; color: #fff; font: 700 10px/1 system-ui, sans-serif; cursor: ew-resize; touch-action: none; box-shadow: none; transform: none; }
#timeline-ruler .daw-loop-handle:hover { background: #a38bea; }
.daw-loop-handle-start { left: 0; }
.daw-loop-handle-end { right: 0; }
#timeline-ruler .daw-loop-handle:focus-visible { outline: 2px solid #fff; outline-offset: -2px; z-index: 2; }
.daw-loop-narrow .daw-loop-band-label { visibility: hidden; }
.daw-loop-narrow .daw-loop-handle-start { transform: translateX(-50%) !important; }
.daw-loop-narrow .daw-loop-handle-end { transform: translateX(50%) !important; }
.daw-loop-editing, .daw-loop-editing .daw-loop-band { cursor: grabbing !important; touch-action: none; }
.daw-loop-shade { position: absolute; top: 0; bottom: 0; box-sizing: border-box; border-left: 1px solid rgba(169,155,255,.4); border-right: 1px solid rgba(169,155,255,.4); background: rgba(153,130,255,.055); pointer-events: none; z-index: 1; }
.daw-edit-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: #aeb6d5; pointer-events: none; z-index: 100; }
.daw-edit-guide.is-snapped { width: 2px; background: #b9f0da; box-shadow: 0 0 6px #b9f0da50; }
.daw-edit-guide-label { position: absolute; top: 4px; left: 6px; padding: 3px 6px; border: 1px solid #686e86; border-radius: 4px; background: #222634; color: #f3f4ff; font: 10px/1.4 ui-monospace, monospace; white-space: nowrap; box-shadow: 0 2px 8px #0003; }
.is-snapped .daw-edit-guide-label { border-color: #86cbb0; color: #c9f9e6; }
.daw-edit-guide-end { background: #aeb6d580; }
.track.daw-edit-target { background-color: rgba(126,146,255,.12); box-shadow: inset 0 0 0 1px rgba(151,169,255,.55); }
.daw-timeline-tools [hidden], .daw-loop-band[hidden], .daw-loop-shade[hidden], .daw-edit-guide[hidden] { display: none !important; }
.daw-mobile-sheet .daw-timeline-tools { display: flex; grid-column: 1 / -1; padding: 12px 0 0; margin-top: 4px; gap: 12px; }
.daw-mobile-sheet .daw-timeline-tools :is(input, select) { height: 44px; min-height: 44px; font-size: 16px; }
.daw-mobile-sheet .daw-timeline-tools #daw-grid-bpm { width: 72px; }
.daw-mobile-sheet .daw-timeline-tools #daw-grid-snap { width: 100px; }
.daw-mobile-sheet .daw-timeline-tools button { min-height: 44px; font-size: 12px; padding: 7px 10px; }
.daw-mobile-sheet .daw-loop-actions { width: 100%; gap: 6px; }
.daw-mobile-sheet .daw-grid-hint { width: 100%; margin: 0; font-size: 11px; }
.daw-mobile-sheet .daw-timeline-divider { display: none; }
@media (max-width: 1100px) { .daw-grid-hint { display: none; } .daw-mobile-sheet .daw-grid-hint { display: inline; } }
@media (prefers-reduced-motion: reduce) { .track.daw-edit-target { transition: none; } }
