/* Release Planning — styles scoped to the planning view on the release detail page */
#planningView { padding: 8px 4px 40px; --plan-blue:#0078d4; --plan-border: var(--da-border-strong); --plan-muted:#605e5c; --plan-red:#d13438; --plan-green:#107c10; --plan-amber:#ca8a00; }
#planningView .plan-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:8px 6px; border-bottom:1px solid var(--plan-border); margin-bottom:10px; }
#planningView .plan-seg { display:inline-flex; border: 1px solid var(--da-border-strong); border-radius:4px; overflow:hidden; }
#planningView .plan-seg button { border:none; background: var(--da-surface); padding:6px 14px; cursor:pointer; font-size:13px; color: var(--da-text); }
#planningView .plan-seg button + button { border-left: 1px solid var(--da-border-strong); }
#planningView .plan-seg button.on { background:var(--plan-blue); color:#fff; }
#planningView .plan-hint { color:var(--plan-muted); font-size:12px; }
#planningView .plan-rolebar { display:none; align-items:center; gap:6px; padding:5px 11px; border-radius:999px; font-size:12px; background:#fff4ce; border:1px solid #e6d98a; color:#6b5900; }
#planningView .plan-rolebar.show { display:inline-flex; }
#planningView .plan-btn { border: 1px solid var(--da-border-strong); background: var(--da-surface); padding:6px 12px; border-radius:4px; cursor:pointer; font-size:13px; }
#planningView .plan-btn:hover { background: var(--da-surface-alt); }
#planningView .plan-btn:disabled { opacity:.5; cursor:not-allowed; }
#planningView .plan-loading { color:var(--plan-muted); padding:16px; }

#planningView .plan-rootzone { border:1px dashed transparent; border-radius:6px; padding:2px; transition:.15s; min-height:20px; }
#planningView .plan-rootzone.detach-armed { border-color:var(--plan-blue); background:#eff6fc; }
#planningView .plan-rootzone.detach-armed::before { content:"Drop here to move to top level (remove parent)"; display:block; color:var(--plan-blue); font-size:12px; padding:6px 10px; }

#planningView .plan-row { display:flex; align-items:center; gap:8px; background: var(--da-surface); border:1px solid var(--plan-border); border-radius:6px; padding:8px 10px; margin:4px 0; box-shadow:0 1.6px 3.6px rgba(0,0,0,.08); cursor:grab; position:relative; }
#planningView .plan-row:hover { border-color: var(--da-border-strong); }
#planningView .plan-row.dragging { opacity:.4; }
#planningView .plan-row.insert-before { box-shadow: 0 -3px 0 0 var(--plan-blue), 0 1.6px 3.6px rgba(0,0,0,.08); }
#planningView .plan-row.insert-after  { box-shadow: 0  3px 0 0 var(--plan-blue), 0 1.6px 3.6px rgba(0,0,0,.08); }
/* ghost clone shown during pointer-based drag — smooth in Chrome/Edge/Firefox */
.plan-row-ghost {
  position: fixed; pointer-events: none; z-index: 9999;
  opacity: .88; border: 2px solid var(--plan-blue) !important;
  background: #eff6fc !important; border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
}
#planningView .plan-row.drop-target  { outline: 2px solid var(--plan-blue);  outline-offset: 1px; background: #eff6fc; }
#planningView .plan-row.drop-invalid { outline: 2px solid var(--plan-red);   outline-offset: 1px; background: #fde7e9; }
#planningView .plan-row.dep-target   { outline: 2px dashed var(--plan-green); outline-offset: 1px; background: #eefbee; }
/* list view — default tab */
#planningView .plan-list-wrap { background: var(--da-surface); border:1px solid var(--plan-border); border-radius:8px; overflow:hidden; }
#planningView .plan-list-table { width:100%; border-collapse:collapse; }
#planningView .plan-list-table th { text-align:left; padding:9px 12px; background: var(--da-surface-alt); border-bottom:2px solid var(--plan-border); font-size:11px; color:var(--plan-muted); text-transform:uppercase; letter-spacing:.05em; font-weight:600; white-space:nowrap; }
#planningView .plan-list-table td { padding:8px 12px; border-bottom:1px solid var(--plan-border); font-size:13px; vertical-align:middle; }
#planningView .plan-list-table tr:last-child td { border-bottom:0; }
#planningView .plan-list-table tr:hover td { background: var(--da-surface-alt); }
#planningView .plan-list-count { font-size:12px; color:var(--plan-muted); padding:6px 2px; }
#planningView .plan-list-indent { color:var(--plan-muted); font-size:11px; margin-right:3px; }
#planningView .plan-avatar { display:inline-grid; place-items:center; width:26px; height:26px; border-radius:50%; background:var(--plan-blue); color:#fff; font-size:10px; font-weight:700; letter-spacing:.3px; line-height:1; overflow:hidden; }
#planningView .plan-avatar-empty { background: var(--da-surface-alt); color: var(--da-text-secondary); font-weight:400; }
#planningView .plan-list-table tr .plan-row-menu { opacity:0; transition:opacity .15s; }
#planningView .plan-list-table tr:hover .plan-row-menu { opacity:1; }

#planningView .plan-caret.hidden { visibility:hidden; }
#planningView .plan-badge { width:13px; height:13px; border-radius:3px; flex:none; }
#planningView .plan-wid { color:var(--plan-muted); font-size:12px; min-width:52px; }
#planningView .plan-title { font-weight:600; }
#planningView .plan-type { color:var(--plan-muted); font-size:12px; }
#planningView .plan-state { font-size:11px; padding:2px 8px; border-radius:999px; border: 1px solid var(--da-border-strong); color:var(--plan-muted); }
#planningView .plan-deps { display:flex; gap:5px; flex-wrap:wrap; }
#planningView .plan-pill { font-size:10px; padding:1px 7px; border-radius:999px; background:#f0eefb; color:#773b93; border:1px solid #e0d8f5; }
#planningView .plan-pill.pred { background:#eef7ff; color:var(--plan-blue); border-color:#cfe6fb; }
#planningView .plan-actions { margin-left:auto; display:flex; align-items:center; gap:8px; }
#planningView .plan-dep-handle { width:22px; height:22px; border-radius:50%; border: 1px solid var(--da-border-strong); display:grid; place-items:center; cursor:crosshair; color:var(--plan-muted); background: var(--da-surface); font-size:12px; }
#planningView .plan-dep-handle:hover { border-color:var(--plan-green); color:var(--plan-green); }
#planningView .plan-icon-btn { width:26px; height:26px; border-radius:4px; border:1px solid transparent; background:transparent; cursor:pointer; color:var(--plan-muted); }
#planningView .plan-icon-btn:hover { background: var(--da-surface-alt); border-color:var(--plan-border); }
#planningView .plan-children { margin-left:26px; border-left:2px solid var(--plan-border); padding-left:10px; }

#planDepSvg { position:fixed; inset:0; pointer-events:none; z-index:1200; }
#planDepSvg line { stroke:var(--plan-green,#107c10); stroke-width:2.5; stroke-dasharray:5 4; }

/* timeline */
#planningView .plan-tl { background: var(--da-surface); border:1px solid var(--plan-border); border-radius:8px; overflow-x:auto; }
#planningView .plan-tl-inner { min-width:100%; }
#planningView .plan-tl-row { display:grid; grid-template-columns:280px 1fr; }
#planningView .plan-tl-row:nth-child(even) .plan-tl-track { background: var(--da-surface-alt); }
#planningView .plan-tl-row:nth-child(even) .plan-tl-label { background: var(--da-surface-alt); }
#planningView .plan-tl-label { padding:8px 12px; border-right:1px solid var(--plan-border); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; position:sticky; left:0; z-index:3; background: var(--da-surface); }
#planningView .plan-tl-track { position:relative; height:34px; }
#planningView .plan-tl-bar { position:absolute; top:6px; height:22px; line-height:22px; border-radius:5px; padding:0 8px; color:#fff; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:88px; box-sizing:border-box; }
#planningView .plan-tl-bar.conflict { outline:2px solid var(--plan-amber); }
#planningView .plan-tl-months { display:flex; border-bottom:2px solid var(--plan-border); }
#planningView .plan-tl-month { flex:1; padding:6px; font-size:12px; color:var(--plan-muted); border-right:1px dashed var(--plan-border); text-align:center; }
#planningView #planTlArrows path { stroke:var(--plan-muted); stroke-width:1.6; fill:none; }
#planningView #planTlArrows path.conflict { stroke:var(--plan-amber); stroke-width:2; }

/* relationships modal */
.plan-modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.4); display:none; place-items:center; z-index:1300; }
.plan-modal-backdrop.show { display:grid; }
.plan-modal { background: var(--da-surface); border-radius:8px; width:460px; max-width:92vw; box-shadow:0 8px 30px rgba(0,0,0,.3); overflow:hidden; font-size:13px; }
.plan-modal h3 { margin:0; padding:14px 18px; border-bottom: 1px solid var(--da-border-strong); font-size:15px; }
.plan-modal .plan-body { padding:16px 18px; max-height:60vh; overflow:auto; }
.plan-modal .plan-foot { padding:12px 18px; border-top: 1px solid var(--da-border-strong); display:flex; justify-content:flex-end; }
.plan-rel-group { margin-bottom:14px; }
.plan-rel-group h4 { margin:0 0 6px; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color: var(--da-text-secondary); }
.plan-rel-item { display:flex; align-items:center; gap:8px; padding:6px 8px; border: 1px solid var(--da-border-strong); border-radius:5px; margin:4px 0; }
.plan-rel-item .x { margin-left:auto; color:#d13438; cursor:pointer; border:none; background:none; font-size:16px; }
.plan-ro-note { background:#fff4ce; border:1px solid #e6d98a; color:#6b5900; padding:8px 10px; border-radius:6px; margin-bottom:12px; }
.plan-picker { width:100%; padding:7px; border: 1px solid var(--da-border-strong); border-radius:4px; font-size:13px; margin-top:6px; }
