.arrangement-preparation{--bg:#07111f;--panel:#0d1929;--panel2:#101f31;--line:#23364c;--text:#eef5ff;--muted:#8fa4bd;--cyan:#35d0e6;--blue:#5b8cff;--violet:#9c6cff;--green:#48d597;--amber:#f5bd4f;--red:#ff6b7d;--shadow:0 16px 44px rgba(0,0,0,.28)}.arrangement-preparation *{box-sizing:border-box}.arrangement-preparation{margin:0;background:linear-gradient(180deg,#06101c,#091522 55%,#07111f);color:var(--text);font:14px/1.4 Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif}.arrangement-preparation .app{min-height:100vh;display:grid;grid-template-columns:235px 1fr}.arrangement-preparation .sidebar{border-right:1px solid #182a3d;background:#081421;padding:20px 14px}.arrangement-preparation .brand{display:flex;gap:10px;align-items:center;font-size:20px;font-weight:800;padding:4px 10px 24px}.arrangement-preparation .logo{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,var(--cyan),var(--violet));display:grid;place-items:center;color:#06101c;font-weight:900}.arrangement-preparation .nav{display:grid;gap:6px}.arrangement-preparation .nav button{border:0;background:transparent;color:#9eb0c5;text-align:left;padding:11px 12px;border-radius:10px;font-weight:650}.arrangement-preparation .nav button.active{background:#11263a;color:#fff}.arrangement-preparation .main{padding:22px;min-width:0}.arrangement-preparation .top{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.arrangement-preparation .crumb{color:var(--muted);font-size:13px}.arrangement-preparation .title{font-size:25px;font-weight:820;margin-top:3px}.arrangement-preparation .actions{display:flex;gap:9px}.arrangement-preparation .btn{border:1px solid #2b4058;background:#122238;color:#e9f2ff;border-radius:10px;padding:10px 13px;font-weight:750;cursor:pointer}.arrangement-preparation .btn.primary{background:linear-gradient(135deg,#35cfe5,#6585ff);color:#06101c;border:0}.arrangement-preparation .btn.ghost:hover,.arrangement-preparation .btn:hover{filter:brightness(1.08)}.arrangement-preparation .tabs{display:flex;gap:7px;border-bottom:1px solid #1c3045;margin-bottom:16px}.arrangement-preparation .tab{padding:10px 13px;color:#91a7c0;border-bottom:2px solid transparent;font-weight:750}.arrangement-preparation .tab.active{color:#fff;border-color:var(--cyan)}.arrangement-preparation .grid{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:15px}.arrangement-preparation .card{background:rgba(13,25,41,.94);border:1px solid #1e3348;border-radius:14px;box-shadow:var(--shadow)}.arrangement-preparation .transport{padding:15px}.arrangement-preparation .transport-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.arrangement-preparation .play{width:42px;height:42px;border:0;border-radius:50%;background:#eaf7ff;color:#06101c;font-size:18px;cursor:pointer}.arrangement-preparation .time{font-variant-numeric:tabular-nums;font-weight:800}.arrangement-preparation .grow{flex:1}.arrangement-preparation .pill{border:1px solid #2b4058;background:#0b1726;color:#cbd8e8;padding:8px 10px;border-radius:9px}.arrangement-preparation .pill input{width:52px;background:transparent;border:0;color:#fff;font-weight:800;outline:0}.arrangement-preparation .toggle{cursor:pointer}.arrangement-preparation .toggle.on{border-color:#3f96a9;color:#7ce8f5;background:#0c2831}.arrangement-preparation .wave-card{margin-top:12px;overflow:hidden}.arrangement-preparation .ruler{height:28px;position:relative;background:#0a1726;border-bottom:1px solid #1d3348;color:#8297b0;font-size:10px}.arrangement-preparation .ruler span{position:absolute;top:7px;transform:translateX(-50%)}.arrangement-preparation .wave{height:250px;position:relative;overflow:hidden;background:linear-gradient(180deg,#0c1b2d,#0a1726)}.arrangement-preparation .gridline{position:absolute;top:0;bottom:0;width:1px;background:#213b52}.arrangement-preparation .gridline.major{background:#36536b}.arrangement-preparation .gridline:after{content:attr(data-bar);position:absolute;top:7px;left:5px;color:#7892aa;font-size:10px}.arrangement-preparation .waveform{position:absolute;left:0;right:0;top:72px;height:100px;display:flex;align-items:center;gap:1px;padding:0 4px;opacity:.86}.arrangement-preparation .bar{flex:1;background:linear-gradient(180deg,#50d7e8,#3d7396);border-radius:2px}.arrangement-preparation .marker{position:absolute;top:0;bottom:0;width:2px;background:var(--violet);cursor:ew-resize;z-index:4}.arrangement-preparation .marker:before{content:"";position:absolute;top:31px;left:-5px;width:12px;height:12px;background:var(--violet);transform:rotate(45deg);border-radius:2px}.arrangement-preparation .marker .label{position:absolute;top:8px;left:6px;white-space:nowrap;background:#211a3b;border:1px solid #604fa3;color:#ddd2ff;padding:5px 7px;border-radius:7px;font-size:11px;font-weight:800}.arrangement-preparation .playhead{position:absolute;top:0;bottom:0;width:2px;background:#55f2c2;z-index:5;pointer-events:none}.arrangement-preparation .playhead:before{content:"";position:absolute;top:0;left:-4px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:8px solid #55f2c2}.arrangement-preparation .timeline-footer{display:flex;gap:9px;align-items:center;padding:12px;border-top:1px solid #1d3348}.arrangement-preparation .section-list{padding:14px;margin-top:12px}.arrangement-preparation .section-row{display:grid;grid-template-columns:92px 1fr 110px 28px;gap:8px;align-items:center;padding:8px;border-bottom:1px solid #182c40}.arrangement-preparation .section-row:last-child{border-bottom:0}.arrangement-preparation .tag{display:inline-flex;padding:5px 7px;border-radius:7px;background:#182a40;color:#d8e5f5;font-weight:750}.arrangement-preparation .timestamp{font-variant-numeric:tabular-nums;background:#091522;border:1px solid #263a51;border-radius:8px;padding:7px;color:#eaf3ff;width:100%}.arrangement-preparation .nudge{display:flex;gap:5px}.arrangement-preparation .nudge button{border:1px solid #294056;background:#102033;color:#a9bed4;border-radius:7px;padding:6px;cursor:pointer}.arrangement-preparation .right{display:grid;gap:15px;align-content:start}.arrangement-preparation .panel-title{font-weight:820;font-size:15px}.arrangement-preparation .sub{color:var(--muted);font-size:12px}.arrangement-preparation .settings{padding:15px}.arrangement-preparation .settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:12px}.arrangement-preparation .field{background:#0a1726;border:1px solid #233a51;border-radius:9px;padding:9px}.arrangement-preparation .field label{display:block;color:#7f97b0;font-size:10px;text-transform:uppercase;letter-spacing:.08em}.arrangement-preparation .field input,.arrangement-preparation .field select{width:100%;margin-top:4px;background:transparent;color:#fff;border:0;outline:0;font-weight:800}.arrangement-preparation .wide{grid-column:1/-1}.arrangement-preparation .confidence{margin-top:10px;color:#8eddbf;font-size:12px}.arrangement-preparation .tracks{padding:15px}.arrangement-preparation .track{display:grid;grid-template-columns:1fr 115px 38px;gap:9px;align-items:center;padding:10px 0;border-bottom:1px solid #1b3044}.arrangement-preparation .track:last-child{border-bottom:0}.arrangement-preparation .track-name{font-weight:700}.arrangement-preparation .pan{width:100%}.arrangement-preparation .panval{font-variant-numeric:tabular-nums;color:#b9c9dc;text-align:right}.arrangement-preparation .suggest{width:100%;margin-top:12px}.arrangement-preparation .notice{padding:12px 14px;background:#0c2430;border:1px solid #1e5665;color:#aeeef5;border-radius:10px;margin-top:12px;font-size:12px}.arrangement-preparation .snapflash{position:absolute;top:45px;z-index:10;background:#123a46;color:#7af2ff;padding:4px 7px;border-radius:6px;font-size:10px;display:none}.arrangement-preparation .mobile-note{display:none}
@media(max-width:1050px){.arrangement-preparation .app{grid-template-columns:1fr}.arrangement-preparation .sidebar{display:none}.arrangement-preparation .grid{grid-template-columns:1fr}.arrangement-preparation .right{grid-template-columns:1fr 1fr}.arrangement-preparation .mobile-note{display:block}.arrangement-preparation .main{padding:14px}}
@media(max-width:700px){.arrangement-preparation .right{grid-template-columns:1fr}.arrangement-preparation .actions .ghost{display:none}.arrangement-preparation .section-row{grid-template-columns:76px 1fr}.arrangement-preparation .section-row .nudge,.arrangement-preparation .section-row .del{display:none}.arrangement-preparation .wave{height:220px}.arrangement-preparation .title{font-size:20px}}

.arrangement-preparation{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;padding:0;overflow:auto;background:#07111e;color:#e8f1ff;z-index:10000}.arrangement-preparation::backdrop{background:#07111e}.arrangement-preparation .app{min-height:100%}.arrangement-preparation select option{background:#102033;color:#fff}.arrangement-preparation button:disabled{opacity:.45;cursor:not-allowed}.arrangement-preparation :focus-visible{outline:2px solid #7ce8f5;outline-offset:3px}.arrangement-preparation .section-row{grid-template-columns:110px minmax(100px,1fr) 100px 145px 32px}.arrangement-preparation .wave canvas{width:100%;height:100%;position:absolute;inset:0;pointer-events:none}.arrangement-preparation .section-row.is-selected{background:#211a3b}.arrangement-preparation .field input{min-width:0}.arrangement-preparation .error{color:#ffafaf}.arrangement-preparation .anchor-editor{max-width:120px}.arrangement-preparation .reference{padding:8px;color:#91a7c0}.arrangement-preparation .section-label{background:#091522;color:#eaf3ff;border:1px solid #263a51;border-radius:8px;min-width:0;padding:7px}.arrangement-preparation .track{grid-template-columns:minmax(80px,1fr) 115px 42px}.arrangement-preparation .settings select{max-width:100%}.arrangement-preparation .mobile-note{padding:8px}@media(max-width:700px){.arrangement-preparation .section-row{grid-template-columns:1fr 1fr}.arrangement-preparation .section-row .nudge{display:flex}.arrangement-preparation .section-row .del{display:block}.arrangement-preparation .actions{flex-wrap:wrap}.arrangement-preparation .actions .ghost{display:block}.arrangement-preparation .transport-row{gap:8px}.arrangement-preparation .main{padding:10px}}
.arrangement-preparation .sidebar{border:0;border-right:1px solid #182a3d;border-radius:0;box-shadow:none;display:block}.arrangement-preparation .tabs .tab{background:transparent;border:0;border-bottom:2px solid transparent;border-radius:0}.arrangement-preparation .tabs .tab.active{border-bottom-color:var(--cyan)}.arrangement-preparation .pill select{background:transparent;color:white;border:0;font-weight:800}.arrangement-preparation [hidden]{display:none!important}
.arrangement-preparation{inset:2vh 2vw;width:96vw;height:96vh;border:1px solid #23364c;border-radius:14px}.arrangement-preparation::backdrop{background:rgba(3,9,17,.88)}.arrangement-preparation .app{grid-template-columns:minmax(0,1fr);min-height:100%}.arrangement-preparation .top .title{font-size:20px;margin:0}
.arrangement-preparation .wave-viewport{overflow-x:auto;overflow-y:hidden;max-width:100%;scroll-behavior:auto}.arrangement-preparation [data-surface]{position:relative;min-width:100%}.arrangement-preparation .wave canvas{position:sticky;left:0;top:0;display:block;max-width:none;pointer-events:none}.arrangement-preparation .timeline-footer{flex-wrap:wrap}.arrangement-preparation .timeline-footer .pill{padding:5px}.arrangement-preparation [data-snap-status]{display:block;color:#8eddbf;font-variant-numeric:tabular-nums}
.arrangement-preparation .wave-viewport{scrollbar-width:none}.arrangement-preparation .wave-viewport::-webkit-scrollbar{display:none}.arrangement-preparation .wave canvas{position:absolute;inset:auto;top:0;height:100%;display:block}.arrangement-preparation .ruler{cursor:ns-resize;touch-action:none;user-select:none}.arrangement-preparation .beat-anchor{position:absolute;bottom:0;top:45px;width:14px;transform:translateX(-7px);border:0;border-left:2px dashed var(--amber);background:transparent;color:var(--amber);z-index:6;cursor:ew-resize;touch-action:none;padding:0}.arrangement-preparation .beat-anchor span{position:absolute;bottom:8px;left:8px;background:#122238;border:1px solid var(--amber);border-radius:7px;padding:4px 6px;white-space:nowrap;font-size:11px}.arrangement-preparation [data-anchor-nudges]{margin-top:8px;flex-wrap:wrap}.arrangement-preparation [data-anchor-nudges] button{font-size:10px}.arrangement-preparation .ruler span{pointer-events:none}
.arrangement-preparation .beat-anchor{border:0}.arrangement-preparation .beat-anchor::before{content:"";position:absolute;top:0;bottom:0;left:7px;border-left:2px dashed var(--amber)}

.arrangement-preparation .wave{touch-action:none;user-select:none}

.arrangement-preparation .section-row{grid-template-columns:92px minmax(0,1fr) 110px 28px}.arrangement-preparation .edit-feedback{display:block;color:var(--muted);font-size:12px;margin:8px 12px}.arrangement-preparation .edit-feedback.error{color:#ffafaf}.arrangement-preparation .magnet-options{margin-top:12px;color:var(--muted);font-size:12px}.arrangement-preparation .magnet-options summary{cursor:pointer}.arrangement-preparation .magnet-options label{display:flex;align-items:center;gap:8px;margin-top:8px}.arrangement-preparation .reference{font-size:11px;padding:6px 8px}@media(max-width:700px){.arrangement-preparation .section-row{grid-template-columns:1fr 1fr}}
/* Contextual emphasis uses the existing preparation palette. */
.arrangement-preparation [data-anchor].needs-anchor { outline: 1px solid #6aa9d8; outline-offset: 2px; }
.arrangement-preparation .anchor-guide { margin: 10px 0 14px; padding: 16px 18px; border: 1px solid #31798d; border-radius: 12px; background: linear-gradient(120deg, #103447, #102a42); color: #d9edf5; font-size: 14px; line-height: 1.5; overflow-wrap: break-word; }
.arrangement-preparation .anchor-guide strong { display: block; color: #eefbff; font-size: 17px; line-height: 1.35; }
.arrangement-preparation .anchor-guide p { margin: 7px 0 10px; }
.arrangement-preparation .anchor-guide-reference { display: inline-block; padding: 5px 9px; border: 1px solid #39798a; border-radius: 7px; background: #0c2635; color: #aeeef5; font-size: 13px; font-weight: 700; }
@media(max-width:700px){.arrangement-preparation .anchor-guide{padding:14px}.arrangement-preparation .anchor-guide strong{font-size:16px}}
.arrangement-preparation .transport-row .play { flex-shrink: 0; }
.arrangement-preparation .grid > section { min-width: 0; }
.arrangement-preparation .section-row{ border-left:3px solid var(--musical-section-color, #94A3B8); padding-left:6px; }
.arrangement-preparation .marker,
.arrangement-preparation .marker:before{ background:var(--musical-section-color, #94A3B8); }
.arrangement-preparation .marker .label{ border-color:var(--musical-section-color, #94A3B8); background:#142331; color:#eef4ff; }

.arrangement-preparation .section-chart-target{grid-column:1/-1;display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}.arrangement-preparation .section-chart-target select{flex:1;min-width:0;font-size:12px}.arrangement-preparation .section-chart-target span{flex-shrink:0}@media(max-width:700px){.arrangement-preparation .section-chart-target{align-items:flex-start;flex-direction:column}.arrangement-preparation .section-chart-target select{width:100%}}

/* Full-width transport; the existing section list and PAN panel remain below. */
.arrangement-preparation .grid > section{display:contents}
.arrangement-preparation .transport{grid-column:1/-1}
.arrangement-preparation .section-list{margin-top:0}
.arrangement-preparation .transport-row{flex-wrap:wrap}
.arrangement-preparation .grid-options{position:relative;font-size:12px;color:var(--muted)}
.arrangement-preparation .grid-options > summary{cursor:pointer;padding:8px;border:1px solid #263a51;border-radius:8px;color:#e8f1ff}
.arrangement-preparation .grid-options > .settings{position:absolute;right:0;top:calc(100% + 6px);z-index:30;width:min(330px,80vw);box-sizing:border-box;background:#102033;box-shadow:0 12px 32px #0008}
.arrangement-preparation .section-row.is-linked{background:color-mix(in srgb,var(--musical-section-color) 11%,#0a1726)}
.arrangement-preparation .section-row.is-linked.is-selected{background:color-mix(in srgb,var(--musical-section-color) 18%,#0a1726)}
.arrangement-preparation .section-row:not(.is-linked).is-selected{background:#132334}
.arrangement-pan-confirm{width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);box-sizing:border-box;overflow:auto;padding:24px;border:1px solid #233a51;border-radius:20px;background:linear-gradient(180deg,#0c1636,#071226);color:#e8f1ff;box-shadow:0 24px 68px #0007;font:inherit}
.arrangement-pan-confirm::backdrop{background:rgba(3,9,17,.7)}
.arrangement-pan-confirm h2{font-size:19px;margin:0 0 12px}
.arrangement-pan-confirm p{font-size:14px;line-height:1.6;color:#bdcce0;margin:0 0 24px}
.arrangement-pan-confirm .actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.arrangement-pan-confirm button{border:1px solid #344960;border-radius:10px;padding:10px 14px;background:#102033;color:#e8f1ff;font:inherit;cursor:pointer}
.arrangement-pan-confirm [data-pan-apply]{background:#8ee8ec;color:#08202c;border-color:#8ee8ec;font-weight:700}
.arrangement-pan-confirm button:focus-visible{outline:2px solid #8ee8ec;outline-offset:3px}
@media(max-width:1050px){
  .arrangement-preparation .transport-row{position:relative}
  .arrangement-preparation .grid-options{position:static}
  .arrangement-preparation .grid-options > .settings{left:0;right:auto;width:min(330px,100%)}
}
