.week-control { min-height: 0; display: grid; gap: 14px; padding: 14px; overflow: auto; background: var(--ux-bg); }
.week-control *, .week-control *::before, .week-control *::after { box-sizing: border-box; }
.week-control > *, .week-stage > *, .week-stage article { min-width: 0; }
.week-stage, .week-capacity, .week-board, .week-commit { border: 1px solid var(--ux-line); border-radius: 7px; color: var(--ux-ink); background: var(--ux-panel); box-shadow: 0 8px 24px rgba(23, 42, 37, .06); }
.week-stage > header, .week-board > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--ux-line); }
.week-stage > header span, .week-board > header span, .capacity-copy > span, .week-commit span, .fixed-blocks header span { color: var(--ux-accent); font-size: 10px; font-weight: 950; letter-spacing: 0; }
.week-stage h2 { margin: 2px 0; font-size: 20px; }
.week-stage header p { margin: 0; color: var(--ux-muted); font-size: 14px; }
.week-capacity { display: grid; grid-template-columns: minmax(210px, .8fr) minmax(260px, 1.5fr) minmax(270px, 1fr); align-items: center; gap: 18px; padding: 18px; border-left: 6px solid #287c6a; }
.capacity-copy { display: grid; gap: 3px; }
.capacity-copy strong { font-size: 34px; line-height: 1; }
.capacity-copy small { color: var(--ux-muted); font-size: 12px; }
.capacity-chart { height: 22px; padding: 4px; overflow: hidden; border: 1px solid var(--ux-line); border-radius: 12px; background: var(--ux-bg); }
.capacity-chart i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #287c6a, #5e98aa); transition: width .25s ease; }
.capacity-signals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.capacity-signals span { display: grid; gap: 2px; padding: 9px; border-left: 3px solid #9a6b26; background: color-mix(in srgb, #9a6b26 7%, var(--ux-panel)); font-size: 11px; }
.capacity-signals b { font-size: 18px; }
.availability-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 14px 10px; }
.availability-grid label, .week-inbox label, .role-card label { display: grid; gap: 5px; color: var(--ux-muted); font-size: 11px; font-weight: 850; }
.week-control input, .week-control select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--ux-line); border-radius: 5px; color: var(--ux-ink); background: var(--ux-panel); font: inherit; font-size: 16px; }
.active-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 0 14px 14px; }
.active-days label { min-height: 44px; display: grid; place-items: center; border: 1px solid var(--ux-line); border-radius: 5px; color: var(--ux-muted); background: var(--ux-bg); font-weight: 900; cursor: pointer; }
.active-days label.selected { border-color: #287c6a; color: #fff; background: #287c6a; }
.active-days input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.fixed-blocks { margin: 0 14px 14px; border: 1px solid var(--ux-line); border-radius: 6px; overflow: hidden; }
.fixed-blocks > header { padding: 11px 12px; border-bottom: 1px solid var(--ux-line); }
.fixed-blocks > header div { display: grid; gap: 2px; }
.fixed-blocks form { display: grid; grid-template-columns: minmax(150px, 1fr) 130px 120px 120px auto; gap: 7px; padding: 10px; }
.fixed-blocks form button, .add-role-form button, .week-assignment > header button, .week-inbox article > button, .week-commit > button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 5px; color: #fff; background: #245f51; font: inherit; font-weight: 900; cursor: pointer; }
.fixed-blocks > div { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 10px 10px; }
.fixed-blocks > div > button { min-height: 44px; display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #8b6b45; border-radius: 5px; color: var(--ux-ink); background: color-mix(in srgb, #9a6b26 8%, var(--ux-panel)); }
.fixed-blocks > div > button span { color: var(--ux-muted); font-size: 11px; }
.fixed-blocks > div > p { margin: 4px; color: var(--ux-muted); font-size: 13px; }
.role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.role-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--ux-line); border-top: 5px solid var(--role); border-radius: 6px; background: color-mix(in srgb, var(--role) 5%, var(--ux-panel)); }
.role-card header { display: flex; justify-content: space-between; gap: 8px; }
.role-card header span { color: var(--ux-muted); font-size: 11px; }
.role-hours { grid-template-columns: 1fr 70px 18px; align-items: center; }
.role-card > button { min-height: 44px; justify-self: end; border: 0; color: var(--ux-muted); background: transparent; font-weight: 800; }
.role-card > button:disabled { opacity: .3; }
.add-role-form { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; padding: 0 12px 12px; }
.week-assignment-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.week-assignment > header { flex-wrap: wrap; }
.week-assignment-actions [data-feature-action="week-optimize"] { background: #3566a8; }
.week-inbox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 12px; }
.week-inbox article { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; border: 1px solid var(--ux-line); border-left: 5px solid #bb6a3d; border-radius: 5px; }
.week-inbox article > div, .week-inbox article > button { grid-column: 1 / -1; }
.week-inbox article > div { display: grid; gap: 2px; }
.week-inbox article small { color: var(--ux-muted); }
.week-empty { grid-column: 1 / -1; margin: 0; padding: 24px; color: var(--ux-muted); text-align: center; }
.week-board { overflow: auto; }
.week-board > div { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); min-width: 1050px; }
.week-board > div > article { min-height: 170px; padding: 9px; border-right: 1px solid var(--ux-line); }
.week-board > div > article.day-off { background: repeating-linear-gradient(135deg, transparent, transparent 8px, color-mix(in srgb, var(--ux-line) 35%, transparent) 8px, color-mix(in srgb, var(--ux-line) 35%, transparent) 9px); }
.week-board h3 { margin: 0 0 9px; font-size: 13px; }
.week-board article > p { color: var(--ux-muted); font-size: 11px; }
.week-block { position: relative; display: grid; gap: 2px; margin-bottom: 7px; padding: 8px 28px 8px 9px; border-left: 4px solid var(--role); border-radius: 3px; background: color-mix(in srgb, var(--role) 9%, var(--ux-panel)); }
.week-block.fixed { --role: #9a6b26; }
.week-block span, .week-block small { color: var(--ux-muted); font-size: 10px; }
.week-block button { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; border: 0; color: var(--ux-muted); background: transparent; font-size: 18px; }
.week-commit { position: sticky; z-index: 4; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px max(14px, env(safe-area-inset-bottom)); border-color: #287c6a; box-shadow: 0 -10px 28px rgba(23, 42, 37, .12); }
.week-commit > div { min-width: 0; display: grid; gap: 3px; }
.week-commit b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-commit > button { min-width: 220px; background: #173f37; }

@media (max-width: 1000px) {
  .week-capacity { grid-template-columns: .8fr 1.2fr; }
  .capacity-signals { grid-column: 1 / -1; }
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fixed-blocks form { grid-template-columns: 1fr 1fr 1fr; }
  .fixed-blocks form button { grid-column: span 2; }
}
@media (max-width: 680px) {
  .week-control { gap: 9px; padding: 8px max(8px, env(safe-area-inset-right)) max(74px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .week-capacity { grid-template-columns: 1fr; gap: 10px; padding: 13px; }
  .capacity-chart, .capacity-signals { grid-column: auto; }
  .capacity-copy strong { font-size: 30px; }
  .capacity-signals span { padding: 7px; }
  .availability-grid { grid-template-columns: 1fr 1fr; padding: 10px; }
  .active-days { padding: 0 10px 10px; gap: 3px; }
  .active-days label { min-height: 42px; font-size: 11px; }
  .fixed-blocks { margin: 0 10px 10px; }
  .fixed-blocks form { grid-template-columns: 1fr 1fr; }
  .fixed-blocks form button { grid-column: 1 / -1; }
  .role-grid, .week-inbox { grid-template-columns: 1fr; padding: 9px; }
  .week-stage > header { align-items: flex-start; }
  .week-assignment-actions { width: 100%; }
  .week-assignment-actions button { flex: 1 1 140px; }
  .add-role-form { grid-template-columns: 1fr 90px; padding: 0 9px 9px; }
  .add-role-form button { grid-column: 1 / -1; }
  .week-inbox article { grid-template-columns: 1fr 1fr; }
  .week-inbox article label:last-of-type { grid-column: 1 / -1; }
  .week-board > div { min-width: 0; grid-template-columns: 1fr; }
  .week-board > div > article { min-height: 88px; border-right: 0; border-bottom: 1px solid var(--ux-line); }
  .week-commit { bottom: 0; min-height: 78px; align-items: center; flex-direction: row; gap: 8px; padding: 9px 10px max(9px, env(safe-area-inset-bottom)); }
  .week-commit > div { flex: 1 1 auto; }
  .week-commit b { display: -webkit-box; overflow: hidden; font-size: 12px; line-height: 1.25; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .week-commit > button { width: 142px; min-width: 142px; padding: 0 9px; font-size: 12px; }
}
