/* Dedicated, dependency-free interaction layer. */
.plan-panel{box-shadow:0 3px 20px #25252305;border-color:#d8d7ce}
.plan-intro{min-height:48px;padding:8px 14px;background:#fdfdfa;color:#414139}
#planLabel{font-weight:650;font-size:12px;letter-spacing:.01em}
.field-tools{display:flex;gap:4px;align-items:center}
.field-tools button{height:29px;min-width:30px;padding:2px 6px;font-size:19px;background:transparent;border-color:transparent}
.field-tools button:hover:not(:disabled){background:#efeee6;border-color:#dbd8c7}
button:disabled{opacity:.35;cursor:default}
.field-tools select{width:113px;min-height:29px;height:29px;padding:3px 6px;margin:0 7px;font-size:11px;border-color:#deddd4;background:#fff}
.workspace.expanded{grid-template-columns:minmax(0,1fr)}
.workspace.expanded aside{display:none}
.board{position:relative;--cell:82px;overscroll-behavior-x:contain;scrollbar-color:#c8c5b7 #f4f3ee;scrollbar-width:thin;isolation:isolate;min-height:330px}
.grid-row{grid-template-columns:190px auto;width:max-content;min-width:100%}
.day-grid{grid-template-columns:repeat(var(--days),var(--cell));width:max-content;min-width:0;padding:14px 0;min-height:80px}
.head-grid{padding:0;min-height:0}
.calendar-head{position:sticky;top:0;z-index:6;box-shadow:0 2px 6px #25252308}
.calendar-head .crew-label{z-index:8;background:#fafaf7}
.crew-label{z-index:5;padding:13px;border-bottom-color:#e7e6dd}
.crew-identity{display:flex;align-items:center;gap:10px}
.crew-identity div{min-width:0}
.crew-identity strong{display:block;font-size:13px}
.crew-identity div>span{display:block;font-size:10px;margin-top:3px}
.crew-label .crew-avatar{display:flex;align-items:center;justify-content:center;width:31px;height:31px;flex-shrink:0;border-radius:8px;background:#eeece0;color:#887229;font-size:11px;font-weight:750}
.date-cell{padding:9px 9px 10px;border-right:1px solid #e9e8e0;background:#fafaf7;color:#62625a}
.date-cell>span{font-size:10px;text-transform:uppercase;letter-spacing:.07em}
.date-cell>strong{font-size:15px;font-weight:650;margin:2px 0 7px;color:#35352f}
.date-cell.today{background:#f7f3e3}
.date-cell.weekend{background:#f1f0eb}
.date-cell.weekend>strong{color:#93938a}
.capacity{color:#887128;line-height:1.35;min-height:30px}
.capacity b{color:#64501d;font-size:13px}
.capacity small{color:#96907b;font-size:9px;margin-top:2px;white-space:nowrap}
.capacity:hover{outline:1px solid #d8c992;outline-offset:3px;background:transparent}
.free-cell{position:relative;min-height:0;user-select:none;cursor:crosshair;border-right-color:#eeede6;background:#fff}
.free-cell:hover{background:#f8f4e3;color:#a0862b;box-shadow:inset 0 0 0 1px #d9c990}
.free-cell.today{background:#fdfbf2}
.free-cell.weekend{background:#f6f5f0}
.free-cell.has-absence{background-image:repeating-linear-gradient(135deg,transparent,transparent 6px,#9e9e9420 6px,#9e9e9420 7px)}
.absence-dot{position:absolute;bottom:-7px;right:6px;width:5px;height:5px;border-radius:50%;background:#99988e}
.booking{display:grid;grid-template-columns:12px minmax(0,1fr) 12px;height:46px;padding:0;margin:0 4px;white-space:nowrap;position:relative;z-index:2;border:1px solid #d9cc9c;border-radius:6px;background:linear-gradient(110deg,#eee5bf,#f7f2de);box-shadow:0 2px 3px #5c4b1206;user-select:none;transition:box-shadow .15s,opacity .15s}
.booking:hover{border-color:#b79a40;box-shadow:0 3px 10px #70571518;z-index:3}
.booking:focus-within{outline:2px solid #b3942b;outline-offset:2px;z-index:3}
.booking-main{border:0;background:none;border-radius:0;min-width:0;padding:6px 3px;text-align:left;cursor:grab;font-size:11px;line-height:1.3;overflow:hidden;color:#4a432d}
.booking-main:hover{background:transparent}
.booking-main strong{font-size:10px;letter-spacing:.015em;color:#85702f;font-weight:650;display:block;overflow:hidden;text-overflow:ellipsis;margin-bottom:3px}
.booking-main span{font-size:12px;font-weight:550;display:block;overflow:hidden;text-overflow:ellipsis;color:#38372e}
.resize-handle{display:block;position:relative;padding:0;border:0;background:none;cursor:ew-resize;border-radius:5px;min-width:0;touch-action:none}
.resize-handle::after{content:'';position:absolute;left:4px;top:15px;height:14px;width:3px;border-left:1px solid #aa8c36;border-right:1px solid #aa8c36;opacity:.5}
.resize-handle:hover{background:#b3942b25}
.resize-handle:hover::after{opacity:1}
.booking.conflicted{background:linear-gradient(110deg,#f2dbd6,#fbefec);border-color:#cf958d}
.booking.conflicted .booking-main strong{color:#a13d32}
.booking.conflicted .resize-handle::after{border-color:#a84b3f}
.booking.is-source{opacity:.23;box-shadow:none}
.drag-ghost{position:absolute;top:14px;height:46px;border:2px solid #b3942b;border-radius:6px;background:#f0e5baef;box-shadow:0 5px 20px #6c53172b;z-index:9;pointer-events:none;padding:5px 12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:11px}
.drag-ghost strong,.drag-ghost span{display:block;overflow:hidden;text-overflow:ellipsis;line-height:1.5}
.drag-ghost.conflicted{border-color:#aa4b40;background:#f8e5e1ef}
body.is-dragging{cursor:grabbing;user-select:none}
body.is-dragging *{cursor:inherit!important}
body.is-dragging .free-cell:hover{box-shadow:none}
#dragStatus{position:fixed;z-index:30;left:50%;bottom:26px;transform:translateX(-50%);padding:11px 20px;background:#2d2d28;color:#faf9f3;border-radius:10px;box-shadow:0 8px 30px #0002;display:flex;align-items:center;gap:14px;max-width:calc(100vw - 24px);pointer-events:none;font-size:12px;border:1px solid #575443}
#dragStatus[hidden]{display:none}
#dragStatus strong{color:#e3cc7f;font-size:12px;white-space:nowrap}
#dragStatus small{font-size:10px;color:#b8b6ab;border-left:1px solid #575443;padding-left:14px}
#dragStatus.conflicted{border-color:#b96557}
#dragStatus.conflicted small{color:#f0b7aa}
.plan-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 14px;border-top:1px solid var(--line);background:#fdfdfa}
.plan-footer .hint{padding:0;border:0;font-size:10px;line-height:1.5}
.plan-footer .legend{white-space:nowrap;font-size:9px}
.backlog-item{border-color:#e5e1d3;background:#fbfaf5;border-radius:7px;cursor:grab;transition:box-shadow .15s,border-color .15s}
.backlog-item:hover{border-color:#cbb974;box-shadow:0 3px 10px #6c531710;background:#faf7ea}
.backlog-item small{display:block;font-size:10px;color:#8e8772;margin-top:10px}
@media(max-width:1050px){.grid-row{grid-template-columns:155px auto}.crew-identity{gap:8px}.crew-label .crew-avatar{width:26px;height:29px}}
@media(max-width:650px){.board{min-height:240px}.plan-intro{padding:8px 10px;gap:6px}.field-tools{gap:1px}.field-tools select{width:94px;font-size:10px;margin:0 3px}.field-tools button{min-width:27px}.plan-footer{padding:10px}.plan-footer .legend{display:none}.booking-main{touch-action:pan-x pan-y}.resize-handle{min-width:14px}.booking{grid-template-columns:14px minmax(0,1fr) 14px}#dragStatus{display:block;min-width:230px;padding:10px 15px}#dragStatus strong,#dragStatus span,#dragStatus small{display:block}#dragStatus small{border-left:0;padding-left:0;margin-top:4px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

/* Compact live capacity and stable crew colors. */
.connection-bar{display:flex;align-items:center;gap:8px;padding:7px 28px;background:#eeeade;color:#675d42;font-size:12px;border-bottom:1px solid #dfd9c8}
.connection-bar>span{margin-right:auto}.connection-bar button{padding:4px 9px;font-size:11px;background:#faf9f3}
.connection-bar [hidden]{display:none}.capacity{display:block;text-align:center;line-height:1.1}
.capacity:hover{background:transparent;text-decoration:underline;text-underline-offset:2px}
.capacity b{font-size:11px;white-space:nowrap;font-variant-numeric:tabular-nums}
.capacity[data-level=partial] b{color:#a33e37}
.capacity[data-level=empty] b{color:#73736d}
.capacity[data-level=full] b{color:#387452}.capacity[data-level=conflict] b{color:#ad4039;text-decoration:underline dotted;text-underline-offset:2px}
.date-cell{position:relative;isolation:isolate;display:flex;flex-direction:column;align-items:center;padding:6px 7px;text-align:center;line-height:1.2;overflow:hidden;border-bottom:2px solid transparent}
.date-cell::before{content:"";position:absolute;inset:0 auto 0 0;width:var(--planned-percent,0%);background:var(--capacity-fill,transparent);z-index:-1;pointer-events:none;transition:width .12s}
.date-cell.today::after{content:"";position:absolute;top:0;left:0;right:0;height:2px;background:var(--gold);pointer-events:none}
.date-cell[data-level=partial]{--capacity-fill:#eed0cb;background:#fcf5f3;border-bottom:2px solid #ba6d64}
.date-cell[data-level=full]{--capacity-fill:#dcecdf;border-bottom:2px solid #438563}
.date-cell[data-level=conflict]{--capacity-fill:#edc1ba;background:#fcf0ed;border-bottom:2px dashed #a33e37}
.date-cell .capacity{margin:3px 0 0}.date-cell>strong{font-size:13px;margin:1px 0 0}
.crew-row .crew-label{border-left:3px solid var(--crew-color)}
.crew-row .crew-avatar{background:color-mix(in srgb,var(--crew-color) 13%,white);color:var(--crew-color)}
.crew-row .booking:not(.conflicted){background:color-mix(in srgb,var(--crew-color) 17%,white);border-color:color-mix(in srgb,var(--crew-color) 48%,white)}
.crew-row .booking:not(.conflicted) .booking-main strong{color:var(--crew-color)}
.crew-row .booking:not(.conflicted) .resize-handle::after{border-color:var(--crew-color)}
.crew-summary{padding:10px 0 10px 9px;margin-bottom:4px;border-left:3px solid var(--crew-color);font-size:12px}.crew-summary small{display:block;color:#757269;font-size:11px;line-height:1.6;margin-top:3px}
.legend .full{background:#438563}.legend .partial{background:#b75149}.legend .conflict{background:#8c2923}.date-cell>span{margin:0;font-size:9px}
@media(max-width:650px){.connection-bar{padding:7px 12px;flex-wrap:wrap;font-size:10px}.connection-bar>span{flex-basis:100%}.connection-bar button{min-height:30px}}

/* Period controls share the segmented navigation language. */
.toolbar>.dates{margin-left:auto;gap:10px;justify-content:flex-end}
.date-navigation{flex-shrink:0}.date-navigation button{padding:6px 10px;min-height:32px;line-height:1.3}
.date-navigation #prev,.date-navigation #next{font-size:22px;padding:2px 9px;min-width:30px}
.date-navigation #today{font-size:12px}.dates #range{font-size:12px;white-space:nowrap;margin:0 2px;color:#686458;font-weight:550}
.period-tabs{flex-shrink:0;gap:2px}.period-tabs button{padding:7px 11px;font-size:12px;white-space:nowrap;min-height:32px}
.period-tabs button.selected{color:#292820;font-weight:650}.compact-period .date-cell{padding:6px 3px;text-align:center}
.compact-period .date-cell.week-start{border-left:1px solid #c8c2b3}
.compact-period .date-cell>span{font-size:8px;letter-spacing:0}.compact-period .date-cell>strong{font-size:12px}
.compact-period .capacity{margin-top:4px;overflow:hidden}.compact-period .capacity b{font-size:9px}
@media(max-width:800px){.toolbar>.dates{gap:7px}.period-tabs button{padding-inline:8px}.dates #range{font-size:11px}}
@media(max-width:650px){.toolbar>.dates{justify-content:space-between;gap:8px}.dates #range{flex:1;text-align:right}.period-tabs{width:100%;display:flex}.period-tabs button{flex:1;min-height:36px}.date-navigation button{min-height:34px}.date-navigation #prev,.date-navigation #next{min-width:34px}}
